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

required and not field missing for non-properties object #39

Closed
xunleii opened this issue Aug 12, 2024 · 3 comments · Fixed by #43
Closed

required and not field missing for non-properties object #39

xunleii opened this issue Aug 12, 2024 · 3 comments · Fixed by #43

Comments

@xunleii
Copy link

xunleii commented Aug 12, 2024

Hi, firstly, thanks for this tool; it really simplifies the generation on JsonSchema.

However, I have a problem with the schema definition; I'd like to generate something like

...
"not" : {
  "anyOf" : [
    { "required" : ["aaa"] },
    { "required" : ["bbb"] }
  ]
}
...

to filter a field coming from a $ref but I can't at the moment because not is missing and required can only be generated inside a properties object (if I understood https://github.com/dadav/helm-schema/blob/main/pkg/schema/schema.go#L359 correctly).

Is it possible to add them to this tool ?

NOTE: I tried this which work as expected; if you want, I can create a PR to add them with few test cases to validate the behavior

@xunleii
Copy link
Author

xunleii commented Aug 17, 2024

Thanks for adding the not keyword!

Do you want me to create a new issue about the required keyword?

@dadav dadav reopened this Aug 18, 2024
@dadav
Copy link
Owner

dadav commented Aug 18, 2024

It's ok, we can still use this issue.

@dadav
Copy link
Owner

dadav commented Aug 31, 2024

Should be fixed in #55

@dadav dadav closed this as completed Sep 6, 2024
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

Successfully merging a pull request may close this issue.

2 participants