api icon indicating copy to clipboard operation
api copied to clipboard

support defaults for required arrays

Open cfm opened this issue 9 months ago • 1 comments

In cfm/ta-attendance-tools#66, I believe I'm encountering the case not handled in:

https://github.com/readmeio/api/blob/39b966c3f1bdc283e3f4d0e2d50484cfbc7a49a1/packages/core/test/lib/getJSONSchemaDefaults.test.ts#L43

I've taken a stab at this in cfm/api@18115a379d70aa72c5b07e76a93d148e5bb039d8, but doesn't seem to be so straightforward after all. :-) If you can give guidance on how you'd like to see this support implemented, I'd be glad to work on it.

cfm avatar Sep 29 '23 22:09 cfm

@cfm I took a stab at this myself this week and I think we're going to have to completely rewrite how getJSONSchemaDefaults works because it currently doesn't keep track of parental default lineage. We actually fixed this same problem in our closed source API Explorer software on ReadMe customer sites and it might be worth refactoring that work out somewhere into our oas library so it can be used here.

erunion avatar Oct 19 '23 07:10 erunion