openapi-contrib / openapi-schema-to-json-schema

Due to the OpenAPI v3.0 and JSON Schema discrepancy, you can use this JS library to convert OpenAPI Schema objects to proper JSON Schema.
https://www.npmjs.com/package/@openapi-contrib/openapi-schema-to-json-schema
MIT License
242 stars 20 forks source link

feat: _keepRequired option #21

Closed P0lip closed 3 years ago

P0lip commented 3 years ago

Needed for https://github.com/stoplightio/platform-internal/issues/5359

marbemac commented 3 years ago

Curious what @philsturgeon thinks, but should it be a bit less opinionated about clobbering required? I feel like rather than a new option it might make more sense to just remove the cleanRequired call altogether. It doesn't interop well at all with allOf.

philsturgeon commented 3 years ago

I am currently trying to find out the context of why cleanRequired exists but I'm not getting very far. It could just be an artifact from the port, but I'm not sure what the point of it is. If we're going to add an option we should document it in README and explain what its for, but if we dont understand the use case we probably dont need the option and can just remove it entirely.

P0lip commented 3 years ago

We can actually close this PR since we no longer need it internally at Stoplight. I went one step further, and removed the dependency entirely in http-spec, here https://github.com/stoplightio/http-spec/pull/128