I'm using swagger for my API documentation of nodejs API. But as a beginner I am not aware about swagger ui. I google it and find a solution for that which is swagger tool but in the swagger tool documentation they use json format but my question is cant we use swagger.yaml (YAML) format for do the same thing.
Asked
Active
Viewed 531 times
-2
-
1You check out the swagger website? https://swagger.io/docs/specification/basic-structure/ – imjared Aug 28 '18 at 11:43
-
Related: [What is the practical different between the usage of JSON and YAML in Swagger?](https://stackoverflow.com/q/46990638/113116) – Helen Aug 28 '18 at 11:53
-
Ok. I will check those. thanks. – Sandaruwan Wijerathne Aug 29 '18 at 04:25
1 Answers
0
According to the OpenAPI Specification (emphasis mine):
An OpenAPI document that conforms to the OpenAPI Specification is itself a JSON object, which may be represented either in JSON or YAML format.
Swagger UI can handle both JSON and YAML definitions. Other OpenAPI-related tools should too - provided that they use a YAML parser. Technically, YAML is a superset of JSON so tools that use YAML parsers (rather than JSON parsers) can parse both YAML and JSON.

Helen
- 87,344
- 17
- 243
- 314