-
Notifications
You must be signed in to change notification settings - Fork 103
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 $ref #170
Comments
Hey @alexisparis , yeah, the schema generation isn't smart enough for this use-case, yet. How restdocs-api-spec generates a JSON schemaThe common brain is in here: Roughly speaking, two payloads produce the same JSON schema, if both are of the same content type and use the same set of FieldDescriptors (two descriptors considered the same, if they document the same JSON path). The reason I'm asking for your |
@ozscheyge thank you for your support |
Okay, the produced resource.json files confirm my assumption: Single resource:
Collection resource:
etc. So, as explained above, the basic algorithm to form the schema from the FieldDescriptors does not detect that those paths may describe the same object. |
Hi @ozscheyge I made some tries with subsectionWithPath but was not able to generate spec as expected. Is there a way to provide a reference type? Do you know how subsectionWithPath should be used in that case? |
Hey, the |
@ozscheyge |
Hey @xeromank , what would be the right way to do this, in your opinion? Could you outline, how you would solve this using |
Hi,
I am trying to use rest-docs / restdocs-api-spec to generate the openapi spec for these two endpoints :
the first endpoint returns a list of Driver and the second one just one driver.
I didn't found yet a way to document that on my unit test.
So, for now, the generated spec contains, in components/schema, a Driver structure and another structure that represents a list of Driver, but on these two structures, the duplication of code is important :
Is there a way to document things so that something like the following will be generated?
The text was updated successfully, but these errors were encountered: