New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OpenAPI Spec incorrectly generated when creating API ME #10968
Comments
Thank you for contacting us! Any issue or feedback from you is quite important to us. We will do our best to fully respond to your issue as soon as possible. Sometimes additional investigations may be needed, we will usually get back to you within 2 days by adding comments to this issue. Please stay tuned. |
Hi, @rabwill , The behavior observed in the generated YAML file is as expected. We utilize the "@apidevtools/swagger-parser" and "js-yaml" libraries to serialize the OpenAPI spec file in the Teams Toolkit. The ">-" symbol in the YAML file eliminates trailing blank lines, enabling you to write lengthy descriptions without line length concerns. The "*ref_0" notation signifies a reference to a reusable component. You can locate the component's position in the generated YAML file, marked as "&ref_0". This is because when parse OpenAPI spec file, component part is dropped, so it will use *ref_x and &ref_x for reuse component. |
Thanks for letting me know it is expected but this is the yaml file generated. Here the response has the schema it is as object, not as reusable component.
Is this also expected behaviour? How would it look if I have another operation that will also give me StockQuoteResponse? |
you can search So the StockQuoteResponse definition is as below: type: object
properties:
01. symbol:
type: string
description: The stock symbol for the equity.
02. open:
type: string
description: The opening price for the stock on the latest trading day.
03. high:
type: string
description: >-
The highest price at which the stock traded during the
latest trading day.
04. low:
type: string
description: >-
The lowest price at which the stock traded during the
latest trading day.
05. price:
type: string
description: The closing price of the stock for the latest trading day.
06. volume:
type: string
description: The volume of shares traded on the latest trading day.
07. latest trading day:
type: string
description: The date of the latest trading day in YYYY-MM-DD format.
08. previous close:
type: string
description: >-
The closing price of the stock for the previous trading
day.
09. change:
type: string
description: >-
The monetary change in the closing price from the previous
trading day to the latest trading day.
10. change percent:
type: string
description: >-
The percentage change in the closing price from the
previous trading day to the latest trading day. |
Describe the bug
When using reusable components as part of schema definition in the OpenAPI spec, the scaffolded yaml file is incorrectly generated
To Reproduce
Steps to reproduce the behavior:
Refer to below OpenAPI spec
openapi.yaml
file.Expected behavior
A valid OpenAPI spec document similar to the one referenced
Screenshots
VS Code Extension Information (please complete the following information):
The text was updated successfully, but these errors were encountered: