-
Notifications
You must be signed in to change notification settings - Fork 323
Open
Labels
bugSomething isn't workingSomething isn't workingopenapi3:converterIssues for @typespec/openapi3 openapi to typespec converterIssues for @typespec/openapi3 openapi to typespec convertertriaged:core
Milestone
Description
Describe the bug
In OpenAPI 3.0 to 3.1 (pre-3.2 changes) a Tag description is optional: https://spec.openapis.org/oas/v3.0.4.html#fixed-fields-18
When running tsp-openapi at v1.5.0 you get the following when you have a Tag with no description:
@tagMetadata("consents")
Which tsp compile then complains about:
TypeSpec compiler v1.5.0
× Compiling
Diagnostics were reported during compilation:
<redacted>:76:1 - error invalid-argument-count: Expected 2 arguments, but got 1.
> 76 | @tagMetadata("consents")
| ^^^^^^^^^^^^^^^^^^^^^^^^
Found 1 error.Suggest changing tsp-openapi to generate the following:
@tagMetadata("consents", #{})
Which is semantically correct and allows the description to continue not existing.
Reproduction
Copy this bad boy into an OpenAPI document, add it to an operation, and run tsp-openapi:
tags:
- name: consents
And you'll see the result.
Checklist
- Follow our Code of Conduct
- Check that there isn't already an issue that request the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion.
- The provided reproduction is a minimal reproducible example of the bug.
Copilot
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingopenapi3:converterIssues for @typespec/openapi3 openapi to typespec converterIssues for @typespec/openapi3 openapi to typespec convertertriaged:core