# Change Log - @typespec/openapi3

## 1.12.0

### Bug Fixes

- [#10180](https://github.com/microsoft/typespec/pull/10180) Fix examples when operation return type have union of response mapping to same status code
- [#10268](https://github.com/microsoft/typespec/pull/10268) Fix missing discriminator mapping entry when the first union variant causes a circular emit, affecting both the OpenAPI 3.0 and 3.2 emitters.


## 1.11.0

### Bug Fixes

- [#10041](https://github.com/microsoft/typespec/pull/10041) [importer] Fix `anyOf` with `$ref` and inline object being incorrectly imported as a model instead of a union.
- [#10046](https://github.com/microsoft/typespec/pull/10046) Fix OpenAPI emitter failing with "Duplicate type name" error when using a named union with a `bytes` variant in a multipart body (e.g. `HttpPart<MyUnion>` where `MyUnion` includes `bytes`).


## 1.10.0

### Features

- [#9577](https://github.com/microsoft/typespec/pull/9577) Add support for OpenAPI 3.2 nested tags via `parent` field in `@tagMetadata` decorator
- [#9890](https://github.com/microsoft/typespec/pull/9890) `file-type` can now receive an array to allow emitting both `json` and `yaml` output in the same run.
- [#9742](https://github.com/microsoft/typespec/pull/9742) Import tool: Support importing `readOnly` and `writeOnly` properties from OpenAPI. 
  - `readOnly: true` is converted to `@visibility(Lifecycle.Read)`
  - `writeOnly: true` is converted to `@visibility(Lifecycle.Create)`
  - Both properties are mutually exclusive, a warning is emitted if both are present and both are ignored

### Bump dependencies

- [#9838](https://github.com/microsoft/typespec/pull/9838) Upgrade dependencies

### Bug Fixes

- [#9634](https://github.com/microsoft/typespec/pull/9634) importer - Fix OpenAPI3 import to support JSON Schema 2020-12 sibling keywords alongside $ref (default, constraints, deprecated, etc.)
- [#9802](https://github.com/microsoft/typespec/pull/9802) openapi3 - Fix `tsp-openapi3` ignoring array constraints (`minItems`, `maxItems`) on nullable arrays defined with `anyOf` + `null`


## 1.9.0

### Features

- [#9629](https://github.com/microsoft/typespec/pull/9629) importer - Add support for importing the `@continuationToken` decorator based on x-ms-list-continuation-token extension
- [#9627](https://github.com/microsoft/typespec/pull/9627) importer - Add support for importing paging link decorators (`@prevLink`, `@nextLink`, `@firstLink`, `@lastLink`) based on x-ms-list-*-link OpenAPI extensions
- [#9609](https://github.com/microsoft/typespec/pull/9609) importer - Add support for x-ms-list extension to add `@list` decorator to operations
- [#9613](https://github.com/microsoft/typespec/pull/9613) importer - Add support for `@offset` decorator when x-ms-list-offset extension is present
- [#9618](https://github.com/microsoft/typespec/pull/9618) importer - Add support for `@pageSize` decorator based on x-ms-list-page-size extension
- [#9615](https://github.com/microsoft/typespec/pull/9615) importer - Add support for x-ms-list-page-items extension to `@pageItems` decorator
- [#9611](https://github.com/microsoft/typespec/pull/9611) importer - Add support for x-ms-list-page-index extension to add `@pageIndex` decorator
- [#9512](https://github.com/microsoft/typespec/pull/9512) Expose performance information when running with `--stats`
- [#9412](https://github.com/microsoft/typespec/pull/9412) importer - OpenAPI number type with duration format now converts to TypeSpec duration type with @encode("seconds", float32) decorator
- [#9584](https://github.com/microsoft/typespec/pull/9584) Expose `openapi-versions` emitter option now that both 3.1.0 and 3.2.0 are implemented.

### Bump dependencies

- [#9446](https://github.com/microsoft/typespec/pull/9446) Upgrade dependencies

### Bug Fixes

- [#9410](https://github.com/microsoft/typespec/pull/9410) importer - null reference exception if member schema cannot be resolved
- [#9533](https://github.com/microsoft/typespec/pull/9533) Fix parameters with default value resulting in `$ref` with `default` as sibling for OpenAPI 3.0
- [#9583](https://github.com/microsoft/typespec/pull/9583) Fix: tag metadata not scopped to the service it was defined on
- [#9475](https://github.com/microsoft/typespec/pull/9475) Handle use of `.now()` constructor on date time types in examples and default.


## 1.8.0

### Features

- [#9289](https://github.com/microsoft/typespec/pull/9289) Add support for importing deprecated properties and types from OpenAPI
- [#9262](https://github.com/microsoft/typespec/pull/9262) Add support for OpenAPI 3.2.0 `defaultMapping` in discriminated unions. When a discriminated union has a default variant (unnamed variant), it is now properly emitted:
  - For OpenAPI 3.2.0: The default variant is included in `oneOf` array and referenced via `discriminator.defaultMapping` property
  - For OpenAPI 3.0 and 3.1: The default variant is included in `oneOf` array and its discriminator value is added to the `discriminator.mapping` object

### Bump dependencies

- [#9223](https://github.com/microsoft/typespec/pull/9223) Upgrade dependencies

### Bug Fixes

- [#9228](https://github.com/microsoft/typespec/pull/9228) Importer: Escape ${...} patterns in extension string property values to prevent interpolation
- [#9236](https://github.com/microsoft/typespec/pull/9236) Fix extension properties with JSON-like strings using escaped string literals to prevent triple-quote syntax issues
- [#9275](https://github.com/microsoft/typespec/pull/9275) import tool - avoid double escaping backslashes
- [#9265](https://github.com/microsoft/typespec/pull/9265) import tool - missing imports for SSE events
- [#9265](https://github.com/microsoft/typespec/pull/9265) import tool - escape SSE event union identifiers when required


## 1.7.0

### Features

- [#9002](https://github.com/microsoft/typespec/pull/9002) Add `commaDelimited` and `newlineDelimited` values to `ArrayEncoding` enum for serializing arrays with comma and newline delimiters

### Bump dependencies

- [#9046](https://github.com/microsoft/typespec/pull/9046) Upgrade dependencies

### Bug Fixes

- [#9164](https://github.com/microsoft/typespec/pull/9164) Import OpenAPI schemas with anyOf/oneOf containing unixtime format correctly emits `@encode(DateTimeKnownEncoding.unixTimestamp, integer)` decorator for nullable utcDateTime properties
- [#9151](https://github.com/microsoft/typespec/pull/9151) Import OpenAPI 3.1/3.2 schemas with contentEncoding: base64 as bytes type with `@encode("base64", string)` decorator
- [#9076](https://github.com/microsoft/typespec/pull/9076) Respect `@externalDocs` on properties
- [#8961](https://github.com/microsoft/typespec/pull/8961) Support nested unions in operation return types


## 1.6.0

### Features

- [#8888](https://github.com/microsoft/typespec/pull/8888) adds support for emission and import of SSE for OpenAPI 3.2
- [#8828](https://github.com/microsoft/typespec/pull/8828) added support for OpenAPI 3.2.0 emission
- [#8830](https://github.com/microsoft/typespec/pull/8830) [converter] Generate separate operations with @sharedRoute for operations with multiple incompatible content types (e.g., multipart/form-data and application/json)
- [#8727](https://github.com/microsoft/typespec/pull/8727) [converter] Generated doc comments render on a single line unless doc has new lines
- [#8580](https://github.com/microsoft/typespec/pull/8580) Add support for min/max value for date time and duration types

### Bump dependencies

- [#8823](https://github.com/microsoft/typespec/pull/8823) Upgrade dependencies

### Bug Fixes

- [#8945](https://github.com/microsoft/typespec/pull/8945) [importer] adds missing value checks before attempting conversion
- [#8773](https://github.com/microsoft/typespec/pull/8773) [importer] fix support of type arrays with null
- [#8829](https://github.com/microsoft/typespec/pull/8829) Fix escaping of ${...} in string literals to prevent interpolation
- [#8871](https://github.com/microsoft/typespec/pull/8871) Import: Convert OpenAPI unixtime format to utcDateTime with @encode decorator
- [#8764](https://github.com/microsoft/typespec/pull/8764) [converter] Fix multi line docs for server variables producing invalid syntax
- [#8727](https://github.com/microsoft/typespec/pull/8727) [converter] Render `@server` with multi line doc correctly
- [#8711](https://github.com/microsoft/typespec/pull/8711) Addressed an issue where `@discriminated` union envelope schemas could sometimes have duplicate names in the context of visibility transforms.


## 1.5.0

### Features

- [#8632](https://github.com/microsoft/typespec/pull/8632) Add a new `operation-id-strategy` option.
  
  - `parent-container` (default and previous behavior) Join operation name with its parent if applicable with an underscore
  - `fqn` Join the path from the service root to the operation with `.`
  - `none` Do not generate operation ids, only include explicit ones set with `@operationId`

### Bug Fixes

- [#8584](https://github.com/microsoft/typespec/pull/8584) [importer] fixes import of additional properties : true {} to result in Record<unknown>
- [#8621](https://github.com/microsoft/typespec/pull/8621) [importer] unwrap single any/oneOf to get semantically meaningful types
- [#8419](https://github.com/microsoft/typespec/pull/8419) adds enum prefix for defaults values of enums on import
- [#8434](https://github.com/microsoft/typespec/pull/8434) do not emit defaults for each member type when importing openapi descriptions
- [#8514](https://github.com/microsoft/typespec/pull/8514) [converter] anyOf/oneOf type + type:null gets imported properly and maintains decorators, documentation,...
- [#8623](https://github.com/microsoft/typespec/pull/8623) [importer] only import multipart request body when it's present
- [#8432](https://github.com/microsoft/typespec/pull/8432) fixes a regression where a null valued default would make the import crash
- [#8605](https://github.com/microsoft/typespec/pull/8605) Fix crash when using a property called `set`
- [#8632](https://github.com/microsoft/typespec/pull/8632) Deduplicate operation ids that would resolve to the same one


## 1.4.0

### Features

- [#8289](https://github.com/microsoft/typespec/pull/8289) adds support for importing OAS const
- [#8385](https://github.com/microsoft/typespec/pull/8385) adds support for providing the namespace name during conversion from OpenAPI
- [#8240](https://github.com/microsoft/typespec/pull/8240) adds support for importing discriminator mappings in openAPI
- [#8272](https://github.com/microsoft/typespec/pull/8272) tsp-openapi3 adds support for importing multipart request bodies
- [#8201](https://github.com/microsoft/typespec/pull/8201) feat: adds support for importing servers
- [#8197](https://github.com/microsoft/typespec/pull/8197) feat: adds support for importing tags metadata

### Bump dependencies

- [#8317](https://github.com/microsoft/typespec/pull/8317) Upgrade dependencies

### Bug Fixes

- [#8267](https://github.com/microsoft/typespec/pull/8267) http parts extensions are now emitted
- [#8369](https://github.com/microsoft/typespec/pull/8369) Operation deprecated field is inherited from containing interface/namespace(s)
- [#8387](https://github.com/microsoft/typespec/pull/8387) fix import to recognize any of type null as union with type and null, not unknown
- [#8225](https://github.com/microsoft/typespec/pull/8225) default value for properties was declared without the proper syntax, leading to compilation issues
- [#8217](https://github.com/microsoft/typespec/pull/8217) invalid symbols being produced by discrminator import
- [#8214](https://github.com/microsoft/typespec/pull/8214) ensures that value notation is used when importing extension values
- [#8215](https://github.com/microsoft/typespec/pull/8215) recognize union types during import even when type object is set
- [#8275](https://github.com/microsoft/typespec/pull/8275) tsp-openapi3: log warnings when operationId is missing from Open API spec, and generate an operation name
- [#8207](https://github.com/microsoft/typespec/pull/8207) Converter: fixed a bug that would cause nullable array schemas to generate as unions with only a `null` variant. These schemas now generate an array variant as well.
- [#8203](https://github.com/microsoft/typespec/pull/8203) Converter: fixed a bug in which union definitions converted from `oneOf`/`anyOf` definitions in OpenAPI3 schemas were missing semicolon delimiters.


## 1.3.0

### Bump dependencies

- [#7978](https://github.com/microsoft/typespec/pull/7978) Upgrade dependencies


## 1.2.0

### Bump dependencies

- [#7674](https://github.com/microsoft/typespec/pull/7674) Upgrade dependencies

### Bug Fixes

- [#7750](https://github.com/microsoft/typespec/pull/7750) Prepends namespace name to array declarations in nested namespaces.
- [#7864](https://github.com/microsoft/typespec/pull/7864) Fixed a bug that caused `model M is T[]` declarations to be renamed to `MItem` incorrectly.


## 1.1.0

### Features

- [#7219](https://github.com/microsoft/typespec/pull/7219) [OpenAPI -> tsp] Add support for converting inline schemas using allOf
- [#7403](https://github.com/microsoft/typespec/pull/7403) Adds support for parameter examples via `@opExample` via the `experimental-parameter-examples` option.


## 1.0.0

### Features

- [#7199](https://github.com/microsoft/typespec/pull/7199) Add "capitalize" string helper to compiler


## 1.0.0-rc.1

### Bug Fixes

- [#6279](https://github.com/microsoft/typespec/pull/6279) Fix various issues when using xml payloads and custom scalars
- [#6887](https://github.com/microsoft/typespec/pull/6887) Fix using union templates


## 1.0.0-rc.0

### Breaking Changes

- [#6557](https://github.com/microsoft/typespec/pull/6557) Remove support for removed feature implicit multipart.
- [#6563](https://github.com/microsoft/typespec/pull/6563) Separate file bodies into their own `bodyKind`.
  
  The HTTP library will now return a body with `bodyKind: "file"` in all cases where emitters should treat the body as a file upload or download. Emitters that previously attempted to recognize File bodies by checking the `type` of an HTTP `"single"` body may now simply check if the `bodyKind` is `"file"`. This applies to all HTTP payloads where an `HttpOperationBody` can appear, including requests, responses, and multipart parts.

### Bump dependencies

- [#6595](https://github.com/microsoft/typespec/pull/6595) Upgrade dependencies

### Bug Fixes

- [#6559](https://github.com/microsoft/typespec/pull/6559) Fix missing application of description on multipart properties
- [#6729](https://github.com/microsoft/typespec/pull/6729) Fix duplicate name error when using named union inside multipart part.
- [#6506](https://github.com/microsoft/typespec/pull/6506) Fix union of custom scalar with `null` creating an `object` with `allOf` reference


## 0.67.0

### Breaking Changes

- [#5977](https://github.com/microsoft/typespec/pull/5977) Minimum node version is now 20

### Deprecations

- [#6305](https://github.com/microsoft/typespec/pull/6305) Related changes based on `http` library deprecation removal.

### Features

- [#6268](https://github.com/microsoft/typespec/pull/6268) `@typespec/versioning` is now an optional dependency.
- [#6286](https://github.com/microsoft/typespec/pull/6286) Remove support for `@discriminator` on union
- [#6327](https://github.com/microsoft/typespec/pull/6327) Remove reference to delete projection feature

### Bump dependencies

- [#6266](https://github.com/microsoft/typespec/pull/6266) Update dependencies

### Bug Fixes

- [#6289](https://github.com/microsoft/typespec/pull/6289) Fix `utcDateTime` and `offsetDateTime` not using format `http-date` in header by default as the default http encoding defines
- [#6411](https://github.com/microsoft/typespec/pull/6411) Add support for new `dryRun` emitter option
- [#6473](https://github.com/microsoft/typespec/pull/6473) Adds support for `@encode` to specify array encodings for `@query` parameters


## 0.66.0

### Breaking Changes

- [#6182](https://github.com/microsoft/typespec/pull/6182) Using `{service-name}` in `tspconfig.yaml` will always interpolate the current service name. `{service-name-if-multiple}` can be used to get the previous behavior

### Features

- [#6059](https://github.com/microsoft/typespec/pull/6059) Add support for new `@discriminated` unions
- [#5994](https://github.com/microsoft/typespec/pull/5994) Adds `seal-object-schemas` emitter option to automatically set additionalProperties/unevaluatedProperties to `{ not: {} }` wherever possible
- [#5961](https://github.com/microsoft/typespec/pull/5961) Updates JsonSchema and Open API 3.1 emitters to use unevaluatedProperties instead of additionalProperties, and updates Open API 3 emitters to match JsonSchema behavior of treating `Record<never>` as setting `additionalProperties: { not: {} }`
- [#6130](https://github.com/microsoft/typespec/pull/6130) updates openapi3 to respect `@headers` `explode` option and use value syntax
- [#6157](https://github.com/microsoft/typespec/pull/6157) Shared operations operationId can now be set if they all share the same value provided by `@operationId`
- [#6006](https://github.com/microsoft/typespec/pull/6006) Expose core library types in API surface.

### Bug Fixes

- [#5901](https://github.com/microsoft/typespec/pull/5901) Fix: `@typespec/openapi3/invalid-component-fixed-field-key` show on incorrect target


## 0.65.0

### Bug Fixes

- [#5893](https://github.com/microsoft/typespec/pull/5893) Updates tsp-openapi3 to support $ref in requestBodies

### Bump dependencies

- [#5690](https://github.com/microsoft/typespec/pull/5690) Upgrade dependencies

### Features

- [#5831](https://github.com/microsoft/typespec/pull/5831) Updates tsp-openapi3 operation response generation to inline expressions and pare down fields with default values. Also adds support for Open API headers and responses $refs.
- [#4931](https://github.com/microsoft/typespec/pull/4931) Migrate versioning implementation to use mutator approach.


## 0.64.0

### Bug Fixes

- [234eaeb](https://github.com/microsoft/typespec/commit/234eaeb223b85689f73ac3971e09f26c985f6c87) Allow void to be the response body type when other fields are present in the model. Previously, using `void` as a response body type would fail compilation if the model contained other fields (like `statusCode`).
- [#5456](https://github.com/microsoft/typespec/pull/5456) Fix: OpenAPI YAML converts strings to boolean

### Features

- [#5372](https://github.com/microsoft/typespec/pull/5372) Adds support for @typespec/json-schema decorators with Open API 3.0 and 3.1 emitters.
- [#5372](https://github.com/microsoft/typespec/pull/5372) Adds support for emitting Open API 3.1 models using the `openapi-versions` emitter configuration option.
Open API 3.0 is emitted by default.


## 0.63.0

### Bug Fixes

- [#5006](https://github.com/microsoft/typespec/pull/5006) Illegal characters in component keys
- [#5274](https://github.com/microsoft/typespec/pull/5274) Added missing peer dependency "openapi-types"

### Features

- [#5029](https://github.com/microsoft/typespec/pull/5029) Add support for `#deprecated` for OpenAPI3Parameter


## 0.62.0

### Bug Fixes

- [#4663](https://github.com/microsoft/typespec/pull/4663) Discriminator properties are marked as required regardless if they are in TypeSpec to match OpenAPI3 spec.
- [#4934](https://github.com/microsoft/typespec/pull/4934) tsp-openapi3 - fixes typespec generation for empty schema
- [#4727](https://github.com/microsoft/typespec/pull/4727) Nullable enum use `allOf` instead of `oneOf`
- [#4708](https://github.com/microsoft/typespec/pull/4708) Updates tsp-openapi3 to include path-level parameters in generated typespec operations.
- [#4873](https://github.com/microsoft/typespec/pull/4873) Updates tsp-openapi3 query decorator generation to use the value arguments.
- [#4672](https://github.com/microsoft/typespec/pull/4672) OpenAPI3 type property should always be set when nullable property is present.

### Bump dependencies

- [#4679](https://github.com/microsoft/typespec/pull/4679) Upgrade dependencies - October 2024

### Features

- [#4761](https://github.com/microsoft/typespec/pull/4761) Add `@cookie` decorator to specify cookie parameters
- [#4214](https://github.com/microsoft/typespec/pull/4214) Add XML support using `@typespec/xml` library
- [#4834](https://github.com/microsoft/typespec/pull/4834) Add support for `@tagMetadata` decorator
- [#4906](https://github.com/microsoft/typespec/pull/4906) Updates tsp-openapi3 to support generating `@summary` decorators for models and operations from schema title and path item summary fields.


## 0.61.0

### Bump dependencies

- [#4424](https://github.com/microsoft/typespec/pull/4424) Bump dependencies

### Features

- [#4423](https://github.com/microsoft/typespec/pull/4423) Added support to use Scalar and Object as default types


## 0.60.0

### Bug Fixes

- [#4133](https://github.com/microsoft/typespec/pull/4133) Fix Bug for OpenAPI 3 Emitter crash on `@useAuth({})`
- [#4123](https://github.com/microsoft/typespec/pull/4123) Fix OpenAPI3 union names when declared within a namespace
- [#4216](https://github.com/microsoft/typespec/pull/4216) Fixes issue in tsp-openapi3 that resulted in component schemas and parameters with the same name being merged into a single TypeSpec data type.
- [#4232](https://github.com/microsoft/typespec/pull/4232) Improves tsp-openapi3 model generation from schemas utilizing allOf. Models will now extend an allOf member if it is a schema reference and the only member with a discriminator. Other members will be spread into the model if defined as a schema reference, or have their properties treated as top-level properties if they are an inline-schema.
- [#4149](https://github.com/microsoft/typespec/pull/4149) Updates tsp-openapi3 conversion of OpenAPI3 component schemas to improve handling of enums, unions, scalars, and aliases.

### Features

- [#4139](https://github.com/microsoft/typespec/pull/4139) Internals: Migrate to new api for declaring decorator implementation


## 0.59.1

### Bug Fixes

- [#4168](https://github.com/microsoft/typespec/pull/4168) Fix: query params are `explode: true` by default in OpenAPI 3.0


## 0.59.0

### Bug Fixes

- [#4046](https://github.com/microsoft/typespec/pull/4046) Fix issue where operation example would produce an empty object when `@body`/`@bodyRoot` was used
- [#4046](https://github.com/microsoft/typespec/pull/4046) Fix operation response body examples showing up for each response.
- [#3912](https://github.com/microsoft/typespec/pull/3912) Fixes bug where union documentation was being applied to each union member in emitted output.
- [#3908](https://github.com/microsoft/typespec/pull/3908) Fixes bug where circular references in unions caused an empty object to be emitted instead of a ref.

### Bump dependencies

- [#3948](https://github.com/microsoft/typespec/pull/3948) Update dependencies

### Features

- [#3894](https://github.com/microsoft/typespec/pull/3894) Add support for `@useRef` on responses
- [#4020](https://github.com/microsoft/typespec/pull/4020) Add support for encoding numeric types as string
- [#3890](https://github.com/microsoft/typespec/pull/3890) `@extension` used on the service namespace will set extension at the root of the document
- [#3932](https://github.com/microsoft/typespec/pull/3932) Add support for URI templates in routes


## 0.58.0

### Bug Fixes

- [#3516](https://github.com/microsoft/typespec/pull/3516) Fix issue that could result in invalid document generation when running `tsp compile` from another directory
- [#3794](https://github.com/microsoft/typespec/pull/3794) Updates tsp-openapi3 to always emit main.tsp when formatting encounters an error.
- [#3839](https://github.com/microsoft/typespec/pull/3839) Updates tsp-openapi3 doc line wrapping to only automatically create newlines when they are present in the original documentation.

### Bump dependencies

- [#3718](https://github.com/microsoft/typespec/pull/3718) Dependency updates July 2024

### Features

- [#3572](https://github.com/microsoft/typespec/pull/3572) Add support for new `@example` and `@opExample` decorator
- [#3663](https://github.com/microsoft/typespec/pull/3663) Adds support for converting OpenAPI3 specs to TypeSpec via the new tsp-openapi3 CLI included in the `@typespec/openapi3` package.
- [#3732](https://github.com/microsoft/typespec/pull/3732) Apply openapi3 extension on Security schemes
- [#3844](https://github.com/microsoft/typespec/pull/3844) Updates tsp-openapi3 to escape identifiers that would otherwise be invalid, and automatically resolve namespaces for schemas with dots in their names.


## 0.57.0

### Bug Fixes

- [#3342](https://github.com/microsoft/typespec/pull/3342) Add support for new multipart constructs in http library
- [#3574](https://github.com/microsoft/typespec/pull/3574) Emit diagnostic when an invalid type is used as a property instead of crashing.

### Bump dependencies

- [#3401](https://github.com/microsoft/typespec/pull/3401) Update dependencies - May 2024

### Features

- [#3022](https://github.com/microsoft/typespec/pull/3022) Add support for new object and array values as default values (e.g. `decimals: decimal[] = #[123, 456.7];`)


## 0.56.0

### Bug Fixes

- [#3218](https://github.com/microsoft/typespec/pull/3218) Fix: `@path` property should be included in unreachable models

### Bump dependencies

- [#3169](https://github.com/microsoft/typespec/pull/3169) Update dependencies

### Features

- [#2945](https://github.com/microsoft/typespec/pull/2945) Add support for new `@bodyRoot` and `@body` distinction


## 0.55.0

### Bug Fixes

- [#3077](https://github.com/microsoft/typespec/pull/3077) Do not crash if using an unsupported intrinsic type
- [#2967](https://github.com/microsoft/typespec/pull/2967) Fix crash: emit `{nullable: true}` when trying to emit `null` in openapi3
- [#3013](https://github.com/microsoft/typespec/pull/3013) Fix: OpenAPI3 not marking part of bytes or something else as `format: binary`
- [#3090](https://github.com/microsoft/typespec/pull/3090) Fix: Literal unions with the same variants keep adding duplicate entries
- [#3049](https://github.com/microsoft/typespec/pull/3049) Fix visibility naming conflict when a model used with `extends` was used in different visibility.

### Bump dependencies

- [#3027](https://github.com/microsoft/typespec/pull/3027) Update dependencies


## 0.54.0

### Bump dependencies

- [#2900](https://github.com/microsoft/typespec/pull/2900) Update dependencies

### Features

- [#2902](https://github.com/microsoft/typespec/pull/2902) Add support for all properties of openapi `info` object on the `@info` decorator
- [#2950](https://github.com/microsoft/typespec/pull/2950) Add `getOpenAPI3` function that takes a TypeSpec program and returns the emitted OpenAPI as an object. Useful for other emitters and tools that want to work with emitted OpenAPI directly without writing it to disk.
- [#2933](https://github.com/microsoft/typespec/pull/2933) Add a new option `safeint-strategy` that can be set to `double-int` to emit `type: integer, format: double-int` instead of `type: integer, format: int64` when using the `safeint` scalar.


## 0.53.2

### Patch Changes

- 4915d5b: Fix: `required` array on schema wasn't using the value provided by `@encodedName`

## 0.53.1

### Patch Changes

- e6a045b: Allow using default values for union property types
- e6a045b: Fix: union of primitive types that gets emitted as an `enum` keeps the description

## 0.53.0

### Patch Changes

- 9726b3d: Fix issues with `nullable` properties used in a cycle being wrapped in `allOf` when not needed
- 05c8597: Fix circular reference would not always inline array properties
- 8ed1d82: Add support for OpenIdConnect auth scheme


## 0.52.0

Wed, 24 Jan 2024 05:46:53 GMT

### Updates

- Add support for `@encodedName` decorator
- Update dependencies

## 0.51.1

Wed, 13 Dec 2023 23:28:17 GMT

### Patches

- Fix: Multipart part of type `bytes[]` is now treated as multiple binary part
- Fix: OpenAPI3 creating conflicting type declaration when type was used in multipart implicit body and json body

## 0.51.0

Wed, 06 Dec 2023 19:40:58 GMT

### Updates

- Handle `bytes` as a multipart part type correctly and produce `type: string, format: binary`
- Added support for string template literals
- Handle: union variants as discriminator
- Migrate code to use the emitter framework
- Emitter will now emit all properties on unreferenced schemas.

## 0.50.0

Wed, 08 Nov 2023 00:07:17 GMT

### Updates

- Fix: Stops emitting an error when using `@body _: void` in operation parameters and treat it as no body.
- Fix issue where using shared routes would, in some cases, result in a "duplicate-header" error.
- `TypeScript` use `types` entry under `exports` of `package.json` instead of legacy `typesVersions` to provide the definition files
- Support `@summary` on data types which emits the JSON Schema `title` property.
- **BREAKING CHANGE** Dropped support for node 16, minimum node version is now 18

## 0.49.0

Wed, 11 Oct 2023 23:31:35 GMT

### Updates

- Removes `@typespec/rest` as a `peerDependency`. Relates to #2391
- Add support for constraints on unions
- Add support for `@returns` and `@errors` doc comment tags.
- Add support for http status code ranges
- Fix: Correctly generate discriminated union mapping property with multiple visibilities involved
- Fix: Crash when assigning a numeric default to a union
- Fix: Using format `ssv` or `pipes` in `@header` produced an invalid OpenAPI3 schema. It will now change the type to string and ignore the format as well as logging a warning.
- Fix: Use `null` as a default
- Allow use of `@oneOf` on model properties
- Fix `OpenAPI` namespace to be `TypeSpec.OpenAPI`.
- Fix issue with CSV format representation.
- Fix issue where openAPI3 for shared routes incorrectly output a statusCode field.
- Update dependencies
- Disable folding of serialized yaml if line is above 80 characters

## 0.48.1

Tue, 19 Sep 2023 19:28:32 GMT

### Patches

- Fix: Correctly generate discriminated union mapping property with multiple visibilities involved

## 0.48.0

Tue, 12 Sep 2023 21:47:11 GMT

### Updates

- Fixed issue where parameters on a PATCH request marked with visibility "create" did not appear.
- Changed yaml parser from `js-yaml` to `yaml`
- Fix: `exclusiveMinimum` and `exclusiveMaximum` properties are booleans in openapi3
- Use `anyOf` instead of `oneOf` for shared route with different request/response bodies
- Fix handling of `Record<T>` in `model is` and `model extends`

## 0.47.0

Tue, 08 Aug 2023 22:32:10 GMT

### Updates

- Handle general encodings for utcDateTime
- Add support for `@info` decorator providing the ability to specify the additional fields from openapi info object.
- Emit diagnostic for empty unions
- Fix: Apply `@minItems` and `@maxItems` decorators on model array.
- Fix `@useRef` decorator serializing `$ref` as an object.
- Support collection formats: simple, form, ssv and pipes.

## 0.46.0

Tue, 11 Jul 2023 22:06:00 GMT

### Updates

- Omitting `x-typespec-name` extension by default from openapi3 output. A new flag `include-x-typespec-name: "inline-only" | "never"` has been added to get previous behavior.
- Update dependencies

## 0.45.0

Tue, 06 Jun 2023 22:44:16 GMT

### Updates

- Support decimal and decimal128 scalar types.
- Uptake doc comment changes. Standard built-in scalar will not have the description included as they are inlined.
- Add description to emitter options
- Update decorators signature to use `{}` instead of `object`
- Fix: Documentation on `model is x[]` was not included in schema description
- Fix: `@encode` encoding doesn't override target type format
- Fix: Encoding resolution for model properties and add back `unixtime`
- Fix: derived scalar doc ignored
- Add signature for missing decorators
- Add handling of `integer`, `float` and `numeric`

## 0.44.0

Wed, 10 May 2023 21:24:00 GMT

### Updates

- **Added** support for `@encode` decorator
- Fix openapi3 emitter to mark request body required
- Support multiple responses for the same status code and content type.
- Fix issue where shared request bodies did not emit correctly.
- Update decorator declaration to use `Model` instead of `object`
- Update dependencies

## 0.43.0

Tue, 11 Apr 2023 18:49:17 GMT

### Updates

- Support shared routes.
- Update to use new `interpolatePath` logic to resolve the `output-file`
- Add tests for overloads within interfaces
- Support new datetime types

## 0.42.0

Mon, 13 Mar 2023 21:30:44 GMT

### Updates

- Avoid Read suffix in schemas split by visibility.

## 0.41.0

Fri, 03 Mar 2023 19:59:17 GMT

### Updates

- Support additionalProperties
- Stop treating models spread into parameters as unreferenced.
- Revert back changelog
- Use new `@typespec/http` library
- Update package.json entrypoint to tspMain
- Rename to TypeSpec
- Update homepage link

## 0.40.0

Tue, 07 Feb 2023 21:56:17 GMT

### Patches

- Convert Ref objects to ref string in OpenAPI YAML output

### Updates

- Fix issue where operation parameters could not target a ModelProperty.
- Sort OpenAPI 3 output
- Don't emit extra "canonical" model when always impacted by visibility

## 0.39.0

Fri, 13 Jan 2023 00:05:26 GMT

### Patches

- Emit style & explode per encoding options
- Generate recursive update schemas with optional properties for resource update operation

### Updates

- Add support for emitting exclusiveMinimum and exclusiveMaximum based on the corresponding decorators
- **Breaking Change** Add yaml serialization for openapi output. Default has been changed to yaml. Use `file-type: json` or `output-file: myfile.json` to use json

## 0.38.0

Wed, 07 Dec 2022 17:21:52 GMT

### Minor changes

- Omit metadata properties of type `never`
- Internal: update to use new `getTypeName` and `getNamespaceString` helper
- Uptake change to `onEmit` signature
- **Breaking change** using new built-in `emitter-output-dir` option instead of custom `output-dir`.
- Add support for multiple services
- Uptake changes to compiler api to support Scalars
- Add support for renamed `url` scalar
- Uptake changes to rest library api

### Patches

- Emit 'deprecated' operation property in openapi3
- Internal: Update tests to change from `emitters` compiler options to `emit` and `options`
- Fix: Respect `@header` and `@query` over the wire name
- Update dependencies

### Updates

- Remove undocumented use of atVersion projection

## 0.17.0

Sat, 12 Nov 2022 00:14:04 GMT

### Minor changes

- Declare decorators in cadl using `extern dec`
- Feature: Add support for `unknown`

### Patches

- Fix: @extension on a model is intrinsic types are being applied

## 0.16.0

Wed, 12 Oct 2022 21:12:35 GMT

### Minor changes

- Use new `getDiscriminatedUnion` helper from compiler
- Empty object as a response will not produce a 204 response anymore
- Implement automatic visibility transformations
- Add support for `@minItems` and `@maxItems` decorators
- Add support for referencing model properties.
- Emitted openapi3 document include all types under the service namespace
- Uptake move of `@discriminator` into compiler
- Add `output-dir` emitter option
- Add support for overloads(Using `@overload` decorator)
- Uptake changes to rest library

### Patches

- Fix: Response headers are marked as required unless optional
- Fix: `Content-Type` request header lookup is case insensitive
- Exclude properties of type `never` when emitting model schemas

## 0.15.0

Thu, 08 Sep 2022 01:04:53 GMT

### Minor changes

- Uptake change to enum members map type
- Use projectedName projection for `json` to get the real over the wire properties.
- Uptake changes to compiler with current projection
- Update decororator state key to allow multiple instance of library to work together.
- React to Type suffix removal
- Support more kinds of unions, fix various union bugs, and add support for @discriminator on unions
- Uptake changes to http service authentication oauth2 scopes

### Patches

- Add support for `@extension` on Server variables

## 0.14.0

Thu, 11 Aug 2022 19:05:23 GMT

### Minor changes

- Added support for default value for properties with enum type.
- Use authentication configured via `@useAuth` http decorator
- Add new emitter option `new-line` to configure emitted line endings
- Uptake changes to type relations
- Support set of unannotated parameters as request body
- Inline generic instantiations without `@friendlyName`
- Uptake new `resolveOperationId` helper from openapi library improving the logic
- Add warning if there is no exposed routes
- Internal: Uptake new compiler helpers to work with template types

### Patches

- Fix: Description being ignored on non-string primitive models
- Fix uninitialized parent namespaces in projection
- Run projections on types returned from getEffectiveType
- fix infinite recursion with self referencing model
- Remove `summary` property set on schemas
- Make response descriptions more consistent

### Updates

- Update Readme.md for new decorators.

## 0.13.0

Fri, 08 Jul 2022 23:22:57 GMT

### Minor changes

- Emitter can take `outputFile` as an option
- Rename emitter options to be `kebab-case`

### Patches

- Inline parameters spread from anonymous model

## 0.12.0

Mon, 13 Jun 2022 23:42:28 GMT

### Minor changes

- Uptake changes to @cadl-lang/rest libraries around accessor
- Uptake changes to decorator context
- Add support for new @server decorator used to specify api endpoints.
- Find good names where possible for anonymous models that differ from named models only by properties that are not part of the schema
- Uptake changes to versioning library using enums for version

### Updates

- Upgrade to TS4.7

## 0.11.0

Fri, 06 May 2022 17:19:57 GMT

### Minor changes

- Uptake change in compiler with children references
- Move decorators to `OpenAPI` namespace
- Uptake change to versioning library
- Remove node 14 support

### Patches

- Fix issue not excluding template models from derived models causing crash
- Fix duplicate `description` in parameters
- Rearrange some aspects of operation output in the OpenAPI emitter
- URI-encode refs

## 0.10.0

Thu, 31 Mar 2022 17:10:49 GMT

### Minor changes

- Include discriminator property in base schema with a boilerplace description
- Add support for `void` type
- Moved http response interpretation to @cadl-lang/rest library.
- implement multiple response content types
- Uptake change to allow versioned dependency with unversioned service

### Patches

- Fix bug with number enums that reference `0`.
- Use parent .model of ModelTypeProperty
- Support browser builds

## 0.9.0

Wed, 09 Mar 2022 17:42:09 GMT

### Minor changes

- @doc and @summary will set the description and summary on extended primitive types
- Emit child models to OpenAPI when parent is emitted
- **Added** support for `@externalDocs` decorator
- Added support for `@knownValues` decorator
- @doc on service namespace set openapi description
- Uptake change to intrinsic types
- Fix issue where a model name the same as Cadl Intrinsic type would be treated the same.

### Patches

- Fix duplicate parameter type definitions in OpenAPI 3 output

## 0.8.0

Tue, 15 Feb 2022 22:35:02 GMT

### Minor changes

- Add validation to oneOf decorator

### Patches

- Add support for separate `@summary` from `@doc`

## 0.7.0

Mon, 14 Feb 2022 03:01:07 GMT

### Minor changes

- refactor status code handling to http library
- Take change in openapi upstream library
- Update decorators to take in api change

### Patches

- Bump dependency versions

## 0.6.0

Fri, 04 Feb 2022 18:00:18 GMT

### Minor changes

- Support union values for status-code and content-type in responses
- Openapi3 support for discriminated unions
- openapi3 emitter support for @error decorator
- Configure for new emitter syntax
- Internals: switch to internal path manipulation
- Extracted decorators into own library `@cadl-lang/openapi`
- Uptake changes in @cadl-lang/rest library improving operation parameter handling
- Update cadl dependencies to peerDependencies
- Add support for versioned services
- Add statusCode decorator for http status code

### Patches

- Adding @format decorator support for openapi3 to emit "format" for string types
- **Fix** Added support for nullable array `xzy[] | null`
- **Fix** issue with @body body: bytes producing `type: string, format: bytes` instead of `type: string, format: binary` for requests and responses
- Use assigned @friendlyName on model types when emitting schema definitions and refs
- Refactor and improve openapi3 return type tests
- Fix status code validation and other minor cleanup
- Support nullable in openapi3 emitter
- Renaming @format decorator to @pattern.

## 0.5.0

Thu, 16 Dec 2021 08:02:20 GMT

### Minor changes

- Generate anyOf or oneOf schemas for Cadl unions in openapi3

### Patches

- Update openapi3 emitter to consume new Cadl.Rest route generation API

## 0.4.2

Wed, 01 Dec 2021 22:56:11 GMT

### Patches

- Add support for extension decorator on parameters and tests
- Add openapi3 support for Cadl safeint
- Add README

## 0.4.1

Thu, 18 Nov 2021 13:58:15 GMT

### Patches

- Enable operation generation from interfaces

## 0.4.0

Thu, 11 Nov 2021 21:46:21 GMT

### Minor changes

- **Added** Support for duration type

## 0.3.1

Thu, 28 Oct 2021 21:17:50 GMT

### Patches

- Use strict diagnostics
- Fix crash on empty enum in openapi3 emitter
- Set shared param definitions in components.parameters
- Fix param default to be in schema
- Fix handling of decorators on parameters in openapi3
- Fix generation of openapi3 response headers
- Define response body for primitive response type
- Remove management.azure.com service host default

## 0.3.0

Fri, 15 Oct 2021 21:33:37 GMT

### Minor changes

- **Added** Support for server default

## 0.2.0

Fri, 17 Sep 2021 00:49:37 GMT

### Minor changes

- Add emitter for OpenAPI 3.0
- Remove support for multiple inheritance

### Patches

- Adding changelog for openapi3 package
- Updates for cadl namespace addition
- This is a test
- Support for emitting `bytes` and new number types
