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

Determine if request and response body descriptions can be separated at rendering time #340

Closed
alek-mongodb opened this issue Aug 28, 2018 · 1 comment
Assignees

Comments

@alek-mongodb
Copy link
Contributor

So that the request description could be rendered in the request section and the response description in the response section. Currently they cannot be separated, as both are part of the operation description field in API Blueprint.

@nir-jacobson
Copy link
Contributor

It is possible to separate the request and response body descriptions by placing each in the description of the Request and Response sections of the API Blueprint, respectively.

I suggest the following:

  • Have StaticDocumentation._generateOperationDescriptor()'s return object have a requests key with an array value. An element of the array describes one possible request under the current operation, and contains the pertinent data in StaticDocumentation._generateOperationDescriptor().requestSchemaElements.
  • Remove StaticDocumentation._generateOperationDescriptor().requestSchemaElements.
  • StaticDocumentation._generateOperationDescriptor().responses is an array and contains a response element corresponding to status code 200 or 201. Have this response element contain the pertinent data in StaticDocumentation._generateOperationDescriptor().responseSchemaElements.
  • Remove StaticDocumentation._generateOperationDescriptor().responseSchemaElements.
  • Move StaticDocumentation._generateOperationDescriptor().parameters into the element(s) of the new StaticDocumentation._generateOperationDescriptor().requests array.
  • Modify carbond/lib/docgen/templates/api-blueprint/body.hbs to render accordingly.

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

2 participants