Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom_schema not used on write_to #1860

Open
braingram opened this issue Nov 1, 2024 · 0 comments
Open

custom_schema not used on write_to #1860

braingram opened this issue Nov 1, 2024 · 0 comments
Milestone

Comments

@braingram
Copy link
Contributor

Description of the problem

Schema passed to custom_schema during AsdfFile.__init__ is not used for write_to.

Example of the problem

import asdf

schema_contents = """%YAML 1.1
---
id: "http://example.com/schemas/your-custom-schema"
$schema: "http://stsci.edu/schemas/yaml-schema/draft-01"
type: object
properties:
  value:
      type: integer"""


with open("my_schema.yaml", "w") as f:
    f.write(schema_contents)

af = asdf.AsdfFile(custom_schema="my_schema.yaml")
af["value"] = "a"
af.write_to("foo.asdf")  # no ValidationError

System information

asdf version: main
python version: 3.10
operating system: mac

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant