You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I want to convert the swagger json schema to c# files and was hoping that some one could direct me to a tool/application that already does this. I have searched on the net but could not find any support to convert schema draft v4 to c# files.
Appreciate any help!
Thanks..
Hey Ron,
So here is what I am trying to achieve:
• Generate a bunch of clr files from the swagger 2.0 json schema (present in swagger-spec)
• Use an existing xml to populate the values required for swagger spec using the above c# files
• Convert these c# files to swagger spec file (.json)
• Use the above spec file in swagger ui to invoke the targetted APIs
I don't have access to the code base of the APIs that I am targeting. All I have is an XML file of the documentation from those APIs. I am using swagger as a tool to invoke these apis, however for that I will need to generate the swagger spec file programmatically from the xml file. Hence, I was thinking of the above steps.
Might be I am missing some potential tool under the swagger project, that can help me achieve this? Could you please provide guidance on this?
Thanks
I think you can do step 1 to 3 differently.
I suggest to:
use your existing XML file to create a Swagger spec in JSON. You are on your own for this task as only you knows the XML input. But this should be quite easy. You don't need specifically C# for this: any langage that can read XML and output JSON would fit.
(your step 4) Use the spec file in swagger-ui (or with swagger-codegen or any other tool that can read swagger specs) to build a client to the targetted APIs
Activity
webron commentedon Sep 26, 2015
It seems like you're confusing two things. There's JSON Schema Draft v4 which has nothing to do with Swagger and there's... Swagger.
if you're looking to convert a Swagger definition to C# code, take a look at either our codegen or Azure's autorest.
sacredMonster commentedon Sep 29, 2015
Hey Ron,
So here is what I am trying to achieve:
• Generate a bunch of clr files from the swagger 2.0 json schema (present in swagger-spec)
• Use an existing xml to populate the values required for swagger spec using the above c# files
• Convert these c# files to swagger spec file (.json)
• Use the above spec file in swagger ui to invoke the targetted APIs
I don't have access to the code base of the APIs that I am targeting. All I have is an XML file of the documentation from those APIs. I am using swagger as a tool to invoke these apis, however for that I will need to generate the swagger spec file programmatically from the xml file. Hence, I was thinking of the above steps.
Might be I am missing some potential tool under the swagger project, that can help me achieve this? Could you please provide guidance on this?
Thanks
dolmen commentedon Oct 7, 2015
I think you can do step 1 to 3 differently.
I suggest to:
webron commentedon Jul 21, 2016
Closing for inactivity. Please reopen if needed.