Expand description
@typespec/openapi3 - OpenAPI 3.x Emitter Decorators and Types
Ported from TypeSpec packages/openapi3
Provides decorators and types for OpenAPI 3.x emitter:
@useRef- Override $ref for a model or property@oneOf- Emit union as oneOf instead of anyOf
Also defines emitter options and OpenAPI version types.
Structs§
- Open
Api3 Emitter Options - OpenAPI 3 emitter options. Ported from TS OpenAPI3EmitterOptions interface.
Enums§
- Experimental
Parameter Examples Strategy - Strategy for emitting parameter examples. Ported from TS ExperimentalParameterExamplesStrategy type.
- IncludeX
Type Spec Name - When to include x-typespec-name extension
- NewLine
- Newline character setting for emitter output
- OneOf
Strategy - Strategy for handling @oneOf in OpenAPI
- Open
ApiVersion - OpenAPI specification version
- Operation
IdStrategy - Strategy for generating operation IDs when @operationId is not used. Ported from TS OperationIdStrategy type.
- Safe
IntStrategy - Strategy for handling safeint type
Constants§
- DIAG_
DEFAULT_ NOT_ SUPPORTED - Diagnostic: Default value not supported in OpenAPI 3.0
- DIAG_
DUPLICATE_ HEADER - Diagnostic: Duplicate header across content types
- DIAG_
EMPTY_ ENUM - Diagnostic: Empty enum not supported
- DIAG_
EMPTY_ UNION - Diagnostic: Empty union not supported
- DIAG_
ENUM_ UNIQUE_ TYPE - Diagnostic: Enum options must be same literal type
- DIAG_
INCONSISTENT_ SHARED_ ROUTE - Diagnostic: Inconsistent shared route request visibility
- DIAG_
INLINE_ CYCLE - Diagnostic: Inline cycle detected
- DIAG_
INVALID_ COMPONENT_ KEY - Diagnostic: Invalid component fixed field key
- DIAG_
INVALID_ FORMAT - Diagnostic: Invalid format for collection format
- DIAG_
INVALID_ MODEL_ PROPERTY - Diagnostic: Invalid model property type
- DIAG_
INVALID_ SCHEMA - Diagnostic: Cannot get schema for type
- DIAG_
INVALID_ SERVER_ VARIABLE - Diagnostic: Invalid server variable type
- DIAG_
INVALID_ STYLE - Diagnostic: Invalid style for parameter
- DIAG_
ONEOF_ UNION - Diagnostic: @oneOf can only be applied to a union or model property with union type
- DIAG_
PATH_ QUERY - Diagnostic: Path contains query string
- DIAG_
PATH_ RESERVED_ EXPANSION - Diagnostic: Reserved expansion in path parameter
- DIAG_
RESOURCE_ NAMESPACE - Diagnostic: Resource must be on namespace
- DIAG_
STATUS_ CODE_ IN_ DEFAULT_ RESPONSE - Diagnostic: Status code in default response
- DIAG_
STREAMS_ NOT_ SUPPORTED - Diagnostic: Streams not supported in OpenAPI 3.0
- DIAG_
UNION_ NULL - Diagnostic: Union containing only null types
- DIAG_
UNSUPPORTED_ AUTH - Diagnostic: Unsupported auth type
- DIAG_
UNSUPPORTED_ STATUS_ CODE_ RANGE - Diagnostic: Unsupported status code range
- DIAG_
XML_ ATTRIBUTE_ INVALID - Diagnostic: XML attribute invalid property type
- DIAG_
XML_ UNWRAPPED_ INVALID - Diagnostic: XML unwrapped invalid property type
- OPENAP
I3_ DECORATORS_ TSP - The TypeSpec source for the OpenAPI3 library decorators
- OPENAP
I3_ NAMESPACE - Namespace for OpenAPI3 types
- STATE_
OPENAPI_ ONE_ OF - State key for @oneOf decorator (openapi3-specific)
- STATE_
USE_ REF - State key for @useRef decorator
Functions§
- apply_
openapi_ one_ of - Apply decorator (flag - no value).
- apply_
use_ ref - Apply decorator (string value).
- create_
openapi3_ library - Create the @typespec/openapi3 library diagnostic map. Ported from TS $lib diagnostics in lib.ts.
- get_
use_ ref - Get decorator value.
- is_
openapi_ one_ of - Check if decorator is applied.