Skip to content
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 for Example Object #618

Closed
edmondchui opened this issue Sep 26, 2014 · 13 comments
Closed

Support for Example Object #618

edmondchui opened this issue Sep 26, 2014 · 13 comments
Milestone

Comments

@edmondchui
Copy link
Contributor

It seems like the example object is not shown in the UI. Here is a sample JSON file with example object:

https://github.com/wordnik/swagger-spec/blob/master/fixtures/v2.0/json/resources/resourceWithExamplePayload.json

When will this be added?

Thanks,
Edmond

@tleveque23
Copy link

+1
I also think this is a must have! I think the "example" value should be displayed in the model schema instead of the default values.

@devel-pa
Copy link

Can we have a third tab after "Model" and "Model schema"? "Model Example"?
Thanks, Paul

@fehguy
Copy link
Contributor

fehguy commented Oct 16, 2014

it seems to me that the "model schema" should go away, because people will care more about either the example value, or the human description of it. Thoughts?

@webron
Copy link
Contributor

webron commented Oct 16, 2014

I can see that - but you don't want to lose the functionality of filling the box with a possible value. Though now we need also to support the XML stuff.

@fehguy
Copy link
Contributor

fehguy commented Oct 16, 2014

yea, but wouldn't that example be best for populating the sample value? With XML of course, if they've switched to xml

@webron
Copy link
Contributor

webron commented Oct 16, 2014

"example" isn't mandatory.

@fehguy
Copy link
Contributor

fehguy commented Oct 16, 2014

Yes, but we'll generate it based on the schema, for json or xml, no?

@webron
Copy link
Contributor

webron commented Oct 16, 2014

I'm not sure we're talking about the same thing. Right now, under the "model schema" display there's a "click to set as a parameter value" text. If you remove the model schema, there's nothing to click to set as value to the parameter.

@fehguy
Copy link
Contributor

fehguy commented Feb 22, 2015

examples are now put in the model definitions.

@fehguy fehguy closed this as completed Feb 22, 2015
@muralilaxman
Copy link

I am still not able to see the "examples" object in Swagger -Local editor (Local Instance). But the same is working fine in Swagger Online Editor. Please advice
My swagger version is 0.7.5 --

my Yaml Code

---
  info: 
    title: "IPS API"
    version: "1.0.0"
    description: "API for Investment Product Services "
    license: 
      name: "IPS"
    contact: {}
  paths: 
    /strategies: 
      get: 
        responses: 
          200: 
            description: "Success"
            schema: 
              items: 
                $ref: "#/definitions/strategies"
              type: "array"
            examples: 
              application/json: 
                - 
                  url: "http://yaml-online-parser.appspot.com/"
                  name: "Yahoo"
                - 
                  url: "http://yaml-online-parser.appspot.com/"
                  name: "Yahoo"

@webron
Copy link
Contributor

webron commented Feb 19, 2016

@muralilaxman you're looking for swagger-editor, and if you're running locally version 0.7.5, then you're using a very old one. Try updating to the latest.

@muralilaxman
Copy link

@webron - I installed the latest swagger editor (2.9.8) locally and ran the above YAML script . But still the exampes model is not showing up..

I followed the steps mentioned in this link to install the Swagger-Editor locally.

https://github.com/swagger-api/swagger-editor

@webron
Copy link
Contributor

webron commented Feb 19, 2016

Then you should open a ticket on that project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants