-
Notifications
You must be signed in to change notification settings - Fork 866
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
Support REST API #181
Comments
It's now supported. |
Hello @vicancy , I am getting an exception when building the docs which says
|
@vdecristofaro {
"$ref": "#/definitions/XXXX",
"type": "XX"
} and inside |
@vicancy Right. this is an extract of the generated swagger
How would you then advice to solve this problem. Is this an issue with docfx? |
why there is extra
inside |
Hello @vicancy as you can see in my referenced issue that has been solved and now generate exactly the code reported by the NSwag project owner. I have also updated the docfx to 1.9.3.
the generated code now is as follow
Could you please tell me how did you generate your json sample? Thank you! |
@vdecristofaro could you provide the json file or github repo for us? I will investigate for you. Thanks. |
Sure @hellosnow. Here is a simple file I am using as a sample. the file is generated by using NSwag tool which by using the WebApiToSwagger generator described here. Thanks! |
@vdecristofaro , I checked your attached swagger json and found its schema is invalid. Could you work with NSwag tool to generate the valid swagger json file? I use http://bigstickcarpet.com/swagger-parser/www/index.html to validate the swagger file, for example "typeName", "enumNames" and "oneOf" is not valid. Some valid swagger files example: http://petstore.swagger.io/v2/swagger.json |
We also have plan to validate the swagger schema #312 |
@hellosnow Could you please advice which kind of swagger generator should I use to create my swagger file? |
Hi @vdecristofaro ,
Considering not sure which language you're using to write for the client/server side, here's the swagger official tools: http://swagger.io/tools/, could you check if there's any suitable for you? |
Hi @hellosnow,
Apart from this, I still do not understand where the circular reference would be. The Swashbuckle generated JSON is correctly handled by the swagger-ui package which shows the generated documentation. I really dont know how to proceed here. |
@vdecristofaro I will look into the Swashbuckle and NSwag tomorrow carefully and give you update later. But I just did one testing on official swagger io and found it cannot be processed:
|
In NSwag v2.43, the missing |
Thanks @RSuter for the quick update. @vdecristofaro could you try to generate the new Swagger json file by NSwag v2.43? We can try to parse the new generated json file in docfx and see whether it works. |
I did it. DocFX now still end with error during the build
I have tried to parse the resulting json at http://bigstickcarpet.com/swagger-parser/www/index.html and i get the following error
|
Ok, now the problem is probably that JSON.net just supports JSON Schema v3, but Swagger requires v4. |
Seems |
Oh well, what a mess this Swagger is... |
Without oneOf you cannot express a nullable property which references another schema (which is not nullable).. |
Well, at the least we clarified something. I have a project with more than one hundred api endpoints. How can I use DocFX to generate documentation? Do you suppose that swaggers have to be created manually? |
I'd like to support this/more scenarios but I need to know how to work around these issues: |
As far as I know, Swashbuckle is ok. @vdecristofaro I remember you used this tool to generate json filw right? Could you provide it to us to test whether it's valid Swagger file? |
@hellosnow
Could you please check why this error occur now? Thank you. UPDATE: I have also found another issue, #223, wich has already been filed on the repository. |
@vdecristofaro I tried to parse the attached json by docfx and it succeeded without error? Which docfx version are you using? Suggest to update to latest bits 2.0.1 I will continue to look into your json on the final formatting. Also I filed some known issue #358 #360 , and will look at #223 , thanks for pointing out. |
Hello @vdecristofaro , how's everything going for rest swagger? For loop reference issue, we have fixed via #453 and #464 .The code is already in dev branch, will release at July 18th. Also, we support more syntax via #358, #359 and #360 . Could you have a try for your project? Any further issues please let us know. |
Great. I will tra to run afgani my test on this and feedback quickly. |
@hellosnow I had the chance to run all my test against the latest release and can confirm that the issue has been solved. the issue can be closed. |
@vdecristofaro glad to hear that, will close the issue now. |
No description provided.
The text was updated successfully, but these errors were encountered: