-
Notifications
You must be signed in to change notification settings - Fork 9k
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
Show schema objects as XML if content type is XML #744
Comments
The UI displays two separate things - The Model and the Model Schema. Disregarding the naming, the Model should remain the same and the Model Schema could change based on the mime type. The tricky part would be to change it dynamically when more than one content-type is allowed. Since the example is a free-form object, it can be anything, and we'll probably just paste it as is. It would still need to be a valid JSON object as the whole spec is in JSON. You could, however, add additional processing and extract the any form of example and manipulate it as needed in the UI. |
Some JS hanging off the content type drop down that changed the model schema format as the content type changed? With swagger 2 it should be able to know what the XML is supposed to look like, I know that was an issue with 1.2. |
+1 for XML support |
Fwiw I hacked together a non-elegant solution for an API I'm trying to understand at the moment (I'm documenting using Swagger as I go because the official aren't entirely accurate): http://trademonster.glenngillen.com Like I said it's not terribly elegant, but solves my current issue (the API is always in XML). Code to make it happen is entirely in JS on the in question in case someone wanted to use it as a stating point. |
Are you able to share your changes or outline the approach? |
I'm hoping I can add this back upstream, but I'm a bit time constrained atm so it'll likely be a few weeks away. In the interim here's what I did:
As I mentioned this isn't an ideal implementation by any stretch. It needs to be updated to switch based on the Response and Parameter types rather than hard-coded assuming it's always XML instead of always JSON. |
Would like to add XML support for default models in 2.1.0-M2 |
That would be great, any idea when 2.1.0-M2 will be? |
Once the API from client is ready to get the raw schema we can render the schema in both JSON and XML formats. swagger-api/swagger-js#311 is opened to provide that API |
Can you tell in which period the xml support will be available? |
Hi, it was targeted to the latest release (2.1.0-M2) but this feature didn't make it. Will be by 2.1 proper. |
When do you think that 2.1 proper will be ready, the XML feature would be very useful. |
@foufee - we aim for 2-3 weeks but can't guarantee. |
+1 for XML support |
Hi. When this feature will be done? I have a Rest API that works only with XML, it would be very useful for me. thanks. |
👍 |
6 similar comments
👍 |
👍 |
👍 |
👍 |
👍 |
👍 |
This would be great. 👍 |
please track meta issue #1248 |
Using latest master swaggerui code with swagger 2.
If the content type is only XML then it looks odd for schema objects to be shown as JSON in swaggerUI.
I haven't yet experimented with the Example object, will that help show the examples as XML instead of JSON? Its hard to tell when there aren't any examples in the swagger 2 spec yet.
It would be good if the model schema representation changed as the content type changed, that way users could more easily cut and paste into the body field to test the api.
The text was updated successfully, but these errors were encountered: