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

Render object descriptions #720

Open
cmeeren opened this issue Nov 21, 2018 · 6 comments
Open

Render object descriptions #720

cmeeren opened this issue Nov 21, 2018 · 6 comments

Comments

@cmeeren
Copy link

cmeeren commented Nov 21, 2018

Consider the following response rendering (this is not related to the oneOf selectors, but they show that there are previously defined schema objects at play here):

image

In my definition, all the objects have a description. However, the description never seems to be rendered anywhere.

I suggest rendering the object's description wherever relevant, e.g. just above the property list shown in the screenshot.

@MrThreepwood
Copy link

I am curious as to what your actual schema looks like. I don't really have any help/solution for you here, but I can't seem to get names to appear in the oneOf selectors, they all simply say object. How did you get it to say ErrorAB and ErrorC etc.?

@cmeeren
Copy link
Author

cmeeren commented Nov 27, 2018

It's title, I think.

MyType:
  title: foo
  oneOf:
    ...

@monolithed
Copy link

monolithed commented Dec 16, 2018

@cmeeren thanks, but title is not the same. I also want to describe my requests within onOf and change my description at the top level of the method.

paths:
  /method:
    post:
      description: My default description
        requestBody:
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/RequestOne'
                  - $ref: '#/components/schemas/RequestTwo'

components:
  schemas:
    RequestOne:
      title: My first request
      description: My optional description for the first method

    RequestSecond:
      title: My second request
      description: My optional description for the second method

@cmeeren
Copy link
Author

cmeeren commented Dec 16, 2018

I think we're talking about different things here. This issue is about rendering object descriptions in the first place. It has nothing to do with oneOf (as stated in the OP), because currently, object descriptions are not rendered at all. I suggest we stick to the topic, and that you use another issue for the oneOf-related question. 🙂

@Globegitter
Copy link

Or maybe this could be something toggable via the options. But either way I agree it would be very useful to be able to have this.

@unarist
Copy link
Contributor

unarist commented Dec 13, 2020

This will be fixed by #1035 or #1231 (both are waiting reviews though).

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

No branches or pull requests

5 participants