Skip to content

January 2023

Breaking Changes

@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: json

or alternatively specify the name of the file you’d want

options:
@typespec/openapi3:
output-file: custom.json

[API] Templated operation inside interface

This breaking change affects libraries and emitters

  • templateArguments property on templated type is deprecated and has been replaced with more detailed templateMapper

    If you where you using the templateArgument to find out if something was a template instance change

    type.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.