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

Sub category does not appear in Demo spec #196

Closed
kevprice83 opened this issue Feb 2, 2017 · 5 comments
Closed

Sub category does not appear in Demo spec #196

kevprice83 opened this issue Feb 2, 2017 · 5 comments
Labels

Comments

@kevprice83
Copy link

I'm just testing this tool and so far it ticks all the boxes. I noticed that the sub category does not render in the demo here. The animated GIF shows the ability to open a sub category and enter the necessary parameters. I am testing with the sample petstore spec on my site and the same issue occurs.

Am I missing something very obvious or is there a dependency I'm not including?

I'm referencing the library via CDN.

@RomanHotsiy
Copy link
Member

The gif was taken from modified locally petstore spec. It is not committed to demo.

@kevprice83
Copy link
Author

So what is necessary to create the subcategory fields? SwaggerUI for example interprets on the first operation a body parameter and produces a text area. Is some extra parameter required to do the same for ReDoc?

@RomanHotsiy
Copy link
Member

In ReDoc we try to document request and response payloads as much as possible. So when SwaggerUI just renders a text area we render payload recursively with all the metadata.

Payload is generated based on SchemaObject from OpenAPI spec which is limited version of JsonSchema Draft 4

Subproperties in JSON Schema are documented with properties keyword. If we take Category definition from demo it may look like this:

Category:
  type: object
  properties:
    subcategory:
      type: object # <- set type of field to object
      properties: # <- here we document subproperties
        name:
          type: string
    id:
      description: Category ID
      type: string
    name:
      description: Category name
      type: string
      minLength: 1

I will update demo spec in the upcoming release.
Let me know if you have any other questions

@kevprice83
Copy link
Author

Thanks @RomanGotsiy I have that working now. I guess I misunderstood the tool slightly and I was expecting to be able to make real requests to the API as SwaggerUI does.

My bad!

@RomanHotsiy
Copy link
Member

@kevprice83 np.

btw ReDoc will have possibility to make real requests. This feature is called API Console and we will start working on it soon.

you can track it in the issue #53 or by subscribing to my twitter @RomanHotsiy

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

No branches or pull requests

2 participants