DapperDox / dapperdox

Beautiful, integrated, OpenAPI documentation.
http://dapperdox.io
GNU General Public License v3.0
409 stars 59 forks source link

Documentation and implementation error #104

Open dox-op opened 5 years ago

dox-op commented 5 years ago

I'm having troubles understanding why this page http://dapperdox.io/docs/spec-references says, and I quote:

Note that only absolute $ref references are allowed in a Swagger specification. Relative references in JSON files generally do not resolve consistently, because of the concept of what the reference is relative to changes from file to file.

I want to point out that not only absolute $ref is allowed in Swagger specification or better if you intend Swagger specification to be OpenAPI too, but the relative $ref is also allowed as described by the specific standard: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#relativeReferences I also link the 2.0 version in the same topic https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#reference-object

I encountered this issue reading the docs and just wanted to point it out. I started reading better the docs after my failed attempt to compile a json which is the root OpenApi definer of my application. It contains the endpoints definitions (aka name and method) and references the body of requests relative to other json in subfolders.

I'll give an example to give a better understanding of the situation. Saying the root OpenApi json definer is OpenApi.json, stored at the same level as the entities folder which contains the definitions of the entities folder. I started DapperDox.exe giving as --spec-dir the folder in which all of those files are stored and --spec-filename OpenApi.json. The logs say that while reading a (random because it changes every time I launch this command) file contained in the entities something went wrong.