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

we only bail on unknown formats for strings #85

Open
mmoskal opened this issue Dec 10, 2024 · 2 comments
Open

we only bail on unknown formats for strings #85

mmoskal opened this issue Dec 10, 2024 · 2 comments

Comments

@mmoskal
Copy link
Collaborator

mmoskal commented Dec 10, 2024

The JSON schema allows formats on numbers and other data. We should bail if we don't understand them.

In particular, numbers have formats int32, int64, double etc in Kubernetes testcases

@hudson-ai
Copy link
Collaborator

I don't think these are part of the JSON Schema spec -- does your favorite json validator actually use these for anything? Might be from extension spec though..?

@mmoskal
Copy link
Collaborator Author

mmoskal commented Dec 10, 2024

All format attributes defined in this section apply to strings, but a format attribute can be specified to apply to any instance types defined in the data model defined in the core JSON Schema. [json-schema]

OK, so if you know a format is a string format, then you can ignore it on non-strings

but if you don't know what a format is, you should assume it applies to the type in question and bail

to be consistent with bailing on unsupported string formats

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

2 participants