Packages
oaspec
0.48.0
0.68.0
0.67.0
0.66.0
0.65.0
0.64.0
0.63.0
0.62.0
0.61.0
0.60.0
0.59.0
0.58.1
0.58.0
0.57.0
0.56.0
0.55.0
0.54.0
0.53.0
0.52.0
0.51.0
0.50.0
0.49.0
0.48.0
0.47.0
0.46.0
0.45.0
0.44.0
0.43.0
0.42.0
0.41.0
0.40.0
0.39.0
0.38.0
0.37.0
0.36.0
0.35.0
0.34.0
0.33.0
0.32.0
0.31.0
0.30.0
0.29.0
0.28.0
0.27.0
0.26.0
0.25.0
0.24.0
0.23.0
0.22.0
0.21.0
0.20.0
0.19.0
0.18.0
0.17.0
0.16.0
0.15.0
0.14.0
0.13.0
0.12.0
0.11.0
0.10.0
0.9.0
0.8.0
0.7.0
0.6.3
0.6.1
0.6.0
0.5.0
0.4.0
0.3.0
0.1.3
Generate Gleam code from OpenAPI 3.x specifications
Current section
Files
Jump to
Current section
Files
src/oaspec@internal@capability.erl
-module(oaspec@internal@capability).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]).
-define(FILEPATH, "src/oaspec/internal/capability.gleam").
-export([registry/0, by_level/1]).
-export_type([support_level/0, capability/0]).
-if(?OTP_RELEASE >= 27).
-define(MODULEDOC(Str), -moduledoc(Str)).
-define(DOC(Str), -doc(Str)).
-else.
-define(MODULEDOC(Str), -compile([])).
-define(DOC(Str), -compile([])).
-endif.
?MODULEDOC(false).
-type support_level() :: supported |
normalizable |
parsed_not_used |
unsupported |
not_handled.
-type capability() :: {capability,
binary(),
binary(),
support_level(),
binary()}.
-file("src/oaspec/internal/capability.gleam", 23).
?DOC(false).
-spec registry() -> list(capability()).
registry() ->
[{capability,
<<"object"/utf8>>,
<<"schema"/utf8>>,
supported,
<<"Object schemas with properties"/utf8>>},
{capability,
<<"string"/utf8>>,
<<"schema"/utf8>>,
supported,
<<"String schemas with enum, format, pattern"/utf8>>},
{capability,
<<"integer"/utf8>>,
<<"schema"/utf8>>,
supported,
<<"Integer schemas"/utf8>>},
{capability,
<<"number"/utf8>>,
<<"schema"/utf8>>,
supported,
<<"Number schemas"/utf8>>},
{capability,
<<"boolean"/utf8>>,
<<"schema"/utf8>>,
supported,
<<"Boolean schemas"/utf8>>},
{capability,
<<"array"/utf8>>,
<<"schema"/utf8>>,
supported,
<<"Array schemas with items"/utf8>>},
{capability,
<<"allOf"/utf8>>,
<<"schema"/utf8>>,
supported,
<<"Schema composition"/utf8>>},
{capability,
<<"oneOf"/utf8>>,
<<"schema"/utf8>>,
supported,
<<"Schema composition with discriminator"/utf8>>},
{capability,
<<"anyOf"/utf8>>,
<<"schema"/utf8>>,
supported,
<<"Schema composition with discriminator"/utf8>>},
{capability,
<<"nullable"/utf8>>,
<<"schema"/utf8>>,
supported,
<<"Nullable fields"/utf8>>},
{capability,
<<"additionalProperties"/utf8>>,
<<"schema"/utf8>>,
supported,
<<"Typed, untyped, forbidden; absent key omits the additional_properties field from generated records"/utf8>>},
{capability,
<<"$ref"/utf8>>,
<<"schema"/utf8>>,
supported,
<<"Local $ref resolution"/utf8>>},
{capability,
<<"enum"/utf8>>,
<<"schema"/utf8>>,
supported,
<<"String enum values"/utf8>>},
{capability,
<<"discriminator"/utf8>>,
<<"schema"/utf8>>,
supported,
<<"With propertyName and mapping"/utf8>>},
{capability,
<<"const"/utf8>>,
<<"schema"/utf8>>,
normalizable,
<<"Normalized to single-value enum"/utf8>>},
{capability,
<<"type: [T, null]"/utf8>>,
<<"schema"/utf8>>,
normalizable,
<<"Normalized to nullable"/utf8>>},
{capability,
<<"type: [T1, T2]"/utf8>>,
<<"schema"/utf8>>,
normalizable,
<<"Normalized to oneOf"/utf8>>},
{capability,
<<"$defs"/utf8>>,
<<"schema"/utf8>>,
unsupported,
<<"Move definitions to components/schemas"/utf8>>},
{capability,
<<"prefixItems"/utf8>>,
<<"schema"/utf8>>,
unsupported,
<<"Tuple types not supported"/utf8>>},
{capability,
<<"if"/utf8>>,
<<"schema"/utf8>>,
unsupported,
<<"Use oneOf/anyOf instead"/utf8>>},
{capability,
<<"then"/utf8>>,
<<"schema"/utf8>>,
unsupported,
<<"Use oneOf/anyOf instead"/utf8>>},
{capability,
<<"else"/utf8>>,
<<"schema"/utf8>>,
unsupported,
<<"Use oneOf/anyOf instead"/utf8>>},
{capability,
<<"dependentSchemas"/utf8>>,
<<"schema"/utf8>>,
unsupported,
<<"Not supported"/utf8>>},
{capability,
<<"not"/utf8>>,
<<"schema"/utf8>>,
unsupported,
<<"Negation not supported"/utf8>>},
{capability,
<<"unevaluatedProperties"/utf8>>,
<<"schema"/utf8>>,
unsupported,
<<"Not supported"/utf8>>},
{capability,
<<"unevaluatedItems"/utf8>>,
<<"schema"/utf8>>,
unsupported,
<<"Not supported"/utf8>>},
{capability,
<<"contentEncoding"/utf8>>,
<<"schema"/utf8>>,
unsupported,
<<"Not supported"/utf8>>},
{capability,
<<"contentMediaType"/utf8>>,
<<"schema"/utf8>>,
unsupported,
<<"Not supported"/utf8>>},
{capability,
<<"contentSchema"/utf8>>,
<<"schema"/utf8>>,
unsupported,
<<"Not supported"/utf8>>},
{capability,
<<"$id"/utf8>>,
<<"schema"/utf8>>,
unsupported,
<<"OpenAPI 3.1 JSON Schema `$id`-backed URL refs are not resolved; use local `#/components/schemas/...` refs instead"/utf8>>},
{capability,
<<"const (non-string)"/utf8>>,
<<"schema"/utf8>>,
unsupported,
<<"Only string `const` is lowered to a single-value enum; non-string `const` (bool, int, number, object, array, null) cannot be represented in generated code"/utf8>>},
{capability,
<<"type: [T1, T2] with type-specific constraints"/utf8>>,
<<"schema"/utf8>>,
unsupported,
<<"Multi-type schemas are rewritten to `oneOf`, which would silently drop type-specific constraints (pattern, minLength, minimum, etc.). Split the schema into separate variants or drop the constraints"/utf8>>},
{capability,
<<"apiKey"/utf8>>,
<<"security"/utf8>>,
supported,
<<"Header, query, cookie"/utf8>>},
{capability,
<<"http"/utf8>>,
<<"security"/utf8>>,
supported,
<<"Bearer, basic, and digest auth"/utf8>>},
{capability,
<<"oauth2"/utf8>>,
<<"security"/utf8>>,
supported,
<<"Bearer token attachment only; token acquisition and refresh are not generated"/utf8>>},
{capability,
<<"openIdConnect"/utf8>>,
<<"security"/utf8>>,
supported,
<<"Bearer token attachment only; discovery and token acquisition are not generated"/utf8>>},
{capability,
<<"mutualTLS"/utf8>>,
<<"security"/utf8>>,
unsupported,
<<"Not supported"/utf8>>},
{capability,
<<"path parameters"/utf8>>,
<<"parameter"/utf8>>,
supported,
<<"With schema validation"/utf8>>},
{capability,
<<"query parameters"/utf8>>,
<<"parameter"/utf8>>,
supported,
<<"Including deepObject"/utf8>>},
{capability,
<<"header parameters"/utf8>>,
<<"parameter"/utf8>>,
supported,
<<"String, int, float, bool"/utf8>>},
{capability,
<<"cookie parameters"/utf8>>,
<<"parameter"/utf8>>,
supported,
<<"With percent-decoding"/utf8>>},
{capability,
<<"allowReserved"/utf8>>,
<<"parameter"/utf8>>,
supported,
<<"Skips percent-encoding"/utf8>>},
{capability,
<<"application/json"/utf8>>,
<<"request"/utf8>>,
supported,
<<"JSON request bodies"/utf8>>},
{capability,
<<"application/x-www-form-urlencoded"/utf8>>,
<<"request"/utf8>>,
supported,
<<"Form bodies"/utf8>>},
{capability,
<<"multipart/form-data"/utf8>>,
<<"request"/utf8>>,
supported,
<<"Multipart upload"/utf8>>},
{capability,
<<"application/octet-stream"/utf8>>,
<<"request"/utf8>>,
supported,
<<"Binary upload (raw bytes; passes through as the body parameter without JSON decoding)"/utf8>>},
{capability,
<<"text/plain"/utf8>>,
<<"request"/utf8>>,
supported,
<<"Plain text request bodies (raw string passthrough; no JSON encoding)"/utf8>>},
{capability,
<<"+json/+xml suffix"/utf8>>,
<<"content-type"/utf8>>,
supported,
<<"Structured syntax suffix media types (e.g. application/problem+json)"/utf8>>},
{capability,
<<"application/json"/utf8>>,
<<"response"/utf8>>,
supported,
<<"JSON responses"/utf8>>},
{capability,
<<"text/plain"/utf8>>,
<<"response"/utf8>>,
supported,
<<"Text passthrough"/utf8>>},
{capability,
<<"application/x-ndjson"/utf8>>,
<<"response"/utf8>>,
supported,
<<"NDJSON streaming, treated as text passthrough"/utf8>>},
{capability,
<<"application/octet-stream"/utf8>>,
<<"response"/utf8>>,
supported,
<<"Binary passthrough"/utf8>>},
{capability,
<<"application/xml"/utf8>>,
<<"response"/utf8>>,
supported,
<<"XML passthrough; no structural decoding yet"/utf8>>},
{capability,
<<"text/xml"/utf8>>,
<<"response"/utf8>>,
supported,
<<"XML passthrough; no structural decoding yet"/utf8>>},
{capability,
<<"server: complex path parameters"/utf8>>,
<<"server-validation"/utf8>>,
unsupported,
<<"Path parameters must be scalar (string, integer, number, boolean)"/utf8>>},
{capability,
<<"server: non-primitive query array items"/utf8>>,
<<"server-validation"/utf8>>,
unsupported,
<<"Query array parameters require inline primitive items"/utf8>>},
{capability,
<<"server: non-primitive header array items"/utf8>>,
<<"server-validation"/utf8>>,
unsupported,
<<"Header array parameters require inline primitive items"/utf8>>},
{capability,
<<"server: complex deepObject properties"/utf8>>,
<<"server-validation"/utf8>>,
unsupported,
<<"deepObject properties must be primitive scalars or primitive array leaves"/utf8>>},
{capability,
<<"server: mixed form-urlencoded request"/utf8>>,
<<"server-validation"/utf8>>,
unsupported,
<<"application/x-www-form-urlencoded must be the sole request content type"/utf8>>},
{capability,
<<"server: complex form-urlencoded fields"/utf8>>,
<<"server-validation"/utf8>>,
unsupported,
<<"Form fields must be primitive scalars, primitive arrays, or shallow nested objects (max 5 levels)"/utf8>>},
{capability,
<<"server: mixed multipart request"/utf8>>,
<<"server-validation"/utf8>>,
unsupported,
<<"multipart/form-data must be the sole request content type"/utf8>>},
{capability,
<<"server: complex multipart fields"/utf8>>,
<<"server-validation"/utf8>>,
unsupported,
<<"Multipart fields must be primitive scalars (or arrays of them)"/utf8>>},
{capability,
<<"server: unsupported request content type"/utf8>>,
<<"server-validation"/utf8>>,
unsupported,
<<"Server router only supports application/json, application/x-www-form-urlencoded, multipart/form-data, application/octet-stream, and text/plain"/utf8>>},
{capability,
<<"webhooks"/utf8>>,
<<"scope"/utf8>>,
parsed_not_used,
<<"Parsed but no codegen"/utf8>>},
{capability,
<<"externalDocs"/utf8>>,
<<"scope"/utf8>>,
parsed_not_used,
<<"Parsed but no codegen"/utf8>>},
{capability,
<<"tags"/utf8>>,
<<"scope"/utf8>>,
parsed_not_used,
<<"Parsed but no codegen"/utf8>>},
{capability,
<<"examples"/utf8>>,
<<"scope"/utf8>>,
parsed_not_used,
<<"Parsed but no codegen"/utf8>>},
{capability,
<<"links"/utf8>>,
<<"scope"/utf8>>,
parsed_not_used,
<<"Parsed but no codegen"/utf8>>},
{capability,
<<"callbacks"/utf8>>,
<<"scope"/utf8>>,
parsed_not_used,
<<"Operation-level and components.callbacks are parsed and preserved (including `$ref` to `#/components/callbacks/...`) but no code is generated for callback endpoints"/utf8>>},
{capability,
<<"xml"/utf8>>,
<<"scope"/utf8>>,
not_handled,
<<"XML annotations ignored"/utf8>>},
{capability,
<<"response headers"/utf8>>,
<<"scope"/utf8>>,
supported,
<<"Response header types generated"/utf8>>},
{capability,
<<"encoding"/utf8>>,
<<"scope"/utf8>>,
parsed_not_used,
<<"Parsed but no codegen"/utf8>>}].
-file("src/oaspec/internal/capability.gleam", 306).
?DOC(false).
-spec by_level(support_level()) -> list(capability()).
by_level(Level) ->
gleam@list:filter(registry(), fun(C) -> erlang:element(4, C) =:= Level end).