-
Notifications
You must be signed in to change notification settings - Fork 9.1k
added description field #632
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
Conversation
@fehguy Can you also add |
@@ -311,6 +311,7 @@ A Path Item may be empty, due to [ACL constraints](#securityFiltering). The path | |||
Field Name | Type | Description | |||
---|:---:|--- | |||
<a name="pathItemRef"></a>$ref | `string` | Allows for an external definition of this path item. The referenced structure MUST be in the format of a [Path Item Object](#pathItemObject). If there are conflicts between the referenced definition and this Path Item's definition, the behavior is *undefined*. | |||
<a name="pathItemDescription"></a>description | An optional, string description, intended to apply to all operations in this path. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No harm done.
@OAI/tdc please chime in with any objections to this |
👍 |
👍 (but I really want a |
|
Just to make sure: Is this meant to be a description for the path (i.e. the resource or group of resources), or a default description for each operation on this path, which can be overridden on operation level? Either way it might need a clearer description. |
@ePaul My understanding is that it is the description of the set of resources pointed to by the path template. |
I'll be the bad guy here (sorry @erikvanzijst) and am going to vote 👎. My reasoning being:
Please note I'm keeping the tooling out of the equation in this case. |
@OAI/tdc Please approve or reject. |
Could you squash your commits upon merge? Other than that, LGTM. |
After much internal debate I have decided to go 👍 on this. I believe it is fairly natural to some kind of describable semantic meaning to the resources identified by a path template. If we end up adding query parameters into the "path" then I think it will fit even better. I don't like the confusion it adds by have two places to add descriptions, but the current location of description encourages "Retrieve the thing", "Update the thing", "Create the thing", "Delete the thing" style of docs. I'd prefer people spend more time telling me what then thing is and less telling my what the HTTP methods do. I recognize that tags provide a workaround, but that workaround cause the description and the path to be in two different parts of the document and it requires generating tags for paths. |
@fehguy thanks for adding Apiary is using the
In case there are no summaries or tags given in the document, Apiary is just rendering URIs in the TOC. We have users reaching out our support and asking how to override the URIs in the TOC and adding So sending a big 👍 from Apiary. |
I'll add a 👍 to the |
@OAI/tdc, glad to see that this is being included. I can understand why it was controversial, but I strongly support @darrelmiller's analysis that "...it is fairly natural to [add] some kind of describable semantic meaning to the resources identified by a path template." But that isn't really consistent with the language in the spec, which says this is a "description, intended to apply to all operations in this path." If it describes the operations (and I hope that's not the case), then I agree with @ePaul: it's important to specify whether operation-level descriptions override or supplement path-level descriptions. It's also rather unlikely that you'd want a single summary to apply to all operations defined within a given path. If it describes the pathItem itself, independent of its operations, then the specification language should communicate that meaning. Personally, I don't think OpenAPI should shy away from acknowledging pathItem as an important organizational component of an API description. Syntactically, it's very substantial. It contains parameters and operations. It feels odd and counter-intuitive to organize the hierarchy this way without giving first-class status to the pathItem. Tags are a very flexible way of grouping operations, even more flexible if they eventually allow a hierarchy. But in many cases, path-level organization is sufficient and is most natural to the API. If anything, it might be helpful to introduce (in a later revision!!!) a grouping construct for pathItems, to address @webron's case of Fully recognizing that it's harder for tools and documentation formats to cope with a range of possible ways in which an API's documentation might be organized. The API author might have used any combination of path-level, operation-level, tag-level and (maybe, someday) path-group-level documentation. I think the answer is for documentation tools to be more adaptable and configurable, so they can present the API in the organizational structure the designer had in mind. IMO, this is just part of OpenAPI's path from an opinionated, prescriptive subset of the web API space to a more general standard, suitable for a broader range of uses. If you made it this far, thanks for reading! ;-) |
added description field [Manually ported merge] Co-authored-by: Tony Tam <[email protected]>
Fixes #534