-
Notifications
You must be signed in to change notification settings - Fork 344
Labels
bugSomething isn't workingSomething isn't workingopenapi3:converterIssues for @typespec/openapi3 openapi to typespec converterIssues for @typespec/openapi3 openapi to typespec converter
Milestone
Description
Clear and concise description of the problem
The following TypeSpec definition
model Foo {
@encode("base64", string)
b64_json?: bytes;
}Leads to the follow OpenAPI 3.1/3.2 descriptions
openapi: 3.2.0
info:
title: (title)
version: 0.0.0
tags: []
paths: {}
components:
schemas:
Foo:
type: object
properties:
b64_json:
type: string
contentEncoding: base64And the following OpenAPI 3.0 description
openapi: 3.0.0
info:
title: (title)
version: 0.0.0
tags: []
paths: {}
components:
schemas:
Foo:
type: object
properties:
b64_json:
type: string
format: base64But importing those to TypeSpec leads to the following result in 3.1/3.2
model Foo {
b64_json?: string;
}And this result in 3.0
model Foo {
@format("base64") b64_json?: string;
}The import result looks correct for OpenAPI 3.0 due to the lack of support for contentEncoding. However the import in 3.1/3.2 should lead to a bytes type and an encode decorator.
Checklist
- Follow our Code of Conduct
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Reactions are currently unavailable
Metadata
Metadata
Labels
bugSomething isn't workingSomething isn't workingopenapi3:converterIssues for @typespec/openapi3 openapi to typespec converterIssues for @typespec/openapi3 openapi to typespec converter