module OutputBuilderOasCommon
Direct including types
Defined in:
output_builder/oas_common.crConstant Summary
-
ANY_OPERATION_METHODS =
WILDCARD_HTTP_METHODS.map(&.downcase) -
OAS2_OPERATION_METHODS =
VALID_OPERATION_METHODS - Set {"trace", "query"} -
Swagger 2.0's Path Item Object has no
tracefield (arrived with OpenAPI 3.0) and noqueryfield (arrived with OpenAPI 3.2, a version Swagger 2.0 will never advance to). Emitting either made the whole document invalid, not just that operation, and anANYroute expands across every verb, sotracealone hit 25 of the fixture tree's OAS2 documents. -
PATH_CONVERTER_TYPES =
Set {"int", "str", "string", "slug", "uuid", "float", "bool", "path"} -
Converter names that can appear in a
<…>path placeholder. Same list the optimizer'sangle_bracket_paramuses, so the two resolve a placeholder the same way. -
UNIONED_OPERATION_KEYS =
Set {"servers", "x-noir-operations", "x-noir-hosts"} -
Operation keys whose value is a list of alternatives rather than a single answer. When two endpoints collapse onto one path+method, keeping the first one's value throws the rest away —
serverswould name one of two hosts,x-noir-operationsone of fifteen GraphQL operations — so these are unioned instead. -
VALID_OPERATION_METHODS =
Set {"get", "put", "post", "delete", "options", "head", "patch", "trace", "query"} -
The operation keys a Path Item Object accepts.
query(RFC 10008) arrived with OpenAPI 3.2, so the oas3 builder only emits it as a real operation key — bumping the document's declaredopenapiversion to 3.2.0 when (and only when) it does; every other emitted document stays on 3.0.3. Swagger 2.0 has no later version to adoptqueryinto and can never express it, soOAS2_OPERATION_METHODSbelow excludes it and a QUERY endpoint keeps degrading to thex-noir-unsupported-methodsextension rather than being dropped or downgraded toget.