January 2023
Breaking Changes
Section titled “Breaking Changes”@typespec/openapi3 Default output-file is openapi.yaml
Section titled “@typespec/openapi3 Default output-file is openapi.yaml”As the openapi3 emitter added support for serializing the openapi document to yaml it changed the default to emit yaml to openapi.yaml.
options: @typespec/openapi3: file-type: jsonor alternatively specify the name of the file you’d want
options: @typespec/openapi3: output-file: custom.json[API] Templated operation inside interface
Section titled “[API] Templated operation inside interface”This breaking change affects libraries and emitters
-
templateArgumentsproperty on templated type is deprecated and has been replaced with more detailedtemplateMapperIf you where you using the
templateArgumentto find out if something was a template instance changetype.templateArguments.length > 0;to
isTemplateInstance(type); -
Interfaces might have some templated operations
If blindly including all operations in an interface you might need to make sure the operation is not a template declaration first.
For example with the following tsp code:
interface Factory {read<T>(): T;ping(): void;}
The emitter probably only wants to include the ping() operation but ignore read(). The isTemplateDeclaration helper can be used to filter out the template operations.