module OutputBuilderOasCommon

Direct including types

Defined in:

output_builder/oas_common.cr

Constant Summary

ANY_OPERATION_METHODS = WILDCARD_HTTP_METHODS.map(&.downcase)
OAS2_OPERATION_METHODS = VALID_OPERATION_METHODS - Set {"trace"}

Swagger 2.0's Path Item Object has no trace field — trace arrived with OpenAPI 3.0. Emitting one made the whole document invalid, not just that operation, and an ANY route expands across every verb, so this 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's angle_bracket_param uses, 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 — servers would name one of two hosts, x-noir-operations one of fifteen GraphQL operations — so these are unioned instead.

VALID_OPERATION_METHODS = Set {"get", "put", "post", "delete", "options", "head", "patch", "trace"}