question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rename Swagger/OpenApi File

See original GitHub issue

I’m submitting a…


[ ] Regression 
[x] Bug report
[x] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

The current OpenApi Schema file is called FILENAME-json, however this is against the standard / recommendation.

Expected behavior

i think, we should rename the file “deployed” OpenAPI Schema file. Currently it is called FILENAME-json (note the -), however, the official “OpenAPI Spec” suggests that the file should be called openapi.json

OpenApi V3

It is RECOMMENDED that the root OpenAPI document be named: openapi.json or openapi.yaml.

( see https://github.com/OAI/OpenAPI-Specification/blob/OpenAPI.next/versions/3.0.0.md#documentStructure )

Although it is “only” a recommendation, i think we should stick to this!

OpenApi 2

By convention, the Swagger specification file is named swagger.json.

(see https://github.com/OAI/OpenAPI-Specification/blob/OpenAPI.next/versions/2.0.md#file-structure )

What is the motivation / use case for changing the behavior?

It bothers me that it does not follow the official recommendations / standards 😟

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
kamilmysliwieccommented, Oct 30, 2019

Notice that document in setup() method is not being modified at all. Hence, you can simply save document value:

const document = SwaggerModule.createDocument(app, options);
// save `document` to file
0reactions
lock[bot]commented, Apr 25, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Renaming APIs | SwaggerHub Documentation
Open the API page. · Click the API name. This will open the API Info panel. Opening the API Info panel · Click...
Read more >
Rename OpenAPI's reference generated swagger.json
when I add an OpenAPI service reference to my project in Visual studio 2019 via "Add new OpenAPI service reference" option. enter image ......
Read more >
Getting Started with OpenAPI Tools | Swagger Open Source
In 2015, SmartBear Software donated the Swagger specification to the Linux Foundation, and renamed the specification to the OpenAPI Specification.
Read more >
What Is the Difference Between Swagger and OpenAPI?
The Specification was renamed to the OpenAPI Specification in 2015. OpenAPI 3.0 is the latest version of the specification. The Swagger tools, ...
Read more >
API Documentation Made Easy with OpenAPI & Swagger
The Swagger Specification, which was renamed to the OpenAPI Specification (OAS), ... API Definition files can be imported into a number of different...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found