helm-schema icon indicating copy to clipboard operation
helm-schema copied to clipboard

`required` and `not` field missing for non-properties object

Open xunleii opened this issue 1 year ago • 2 comments

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 avatar Aug 12 '24 11:08 xunleii

Thanks for adding the not keyword!

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

xunleii avatar Aug 17 '24 19:08 xunleii

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

dadav avatar Aug 18 '24 15:08 dadav

Should be fixed in #55

dadav avatar Aug 31 '24 17:08 dadav