Instead of just fixing the problem for enum (see #701), I assume we can pass everything from the JSON Schema into the OpenAPI parameter's spec.
See the last OpenAPI test for an, admittedly, contrived scenario, which may however show why it may be short-sighted to only render the string specific keywords (pattern, format, minLength, maxLength). [This test is only for demo purposes]
In the end, this is similar to how we handle query parameters already, so this PR ended up basically just removing code.
While I'd always recommend separating the OpenAPI (Web) specific spec props (style, explode) from the JSON Schema, we pass it on in case of query params, so we should do that for headers the same way we treat query params anyway.
Currently, we do not pass allowReserved (OpenAPI v3), which I assume to be missing rather than an intended exclusion, in that case, should we add it? Added
Checklist
npm run test
andnpm run benchmark
Instead of just fixing the problem for
enum
(see #701), I assume we can pass everything from the JSON Schema into the OpenAPI parameter's spec. See the last OpenAPI test for an, admittedly, contrived scenario, which may however show why it may be short-sighted to only render thestring
specific keywords (pattern
,format
,minLength
,maxLength
). [This test is only for demo purposes]Whenever the type is not
string
, it may make sense to make to explicitly set thestyle
property. https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#parameter-object https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#style-valuesIn the end, this is similar to how we handle
query
parameters already, so this PR ended up basically just removing code.While I'd always recommend separating the OpenAPI (Web) specific spec props (
style
,explode
) from the JSON Schema, we pass it on in case of query params, so we should do that for headers the same way we treat query params anyway.Currently, we do not passAddedallowReserved
(OpenAPI v3), which I assume to be missing rather than an intended exclusion, in that case, should we add it?