Openapi-specification: Add the opportunity to nest path item object

Created on 30 May 2017  路  4Comments  路  Source: OAI/OpenAPI-Specification

Hi,
I think it will be useful to add support to something like this:

/path:
    /nestedpath:
        /anothernestedpath:
            get: ...
            post: ...

It can be useful to create more clean and less tidy specs

Most helpful comment

Supporting this style of spec structure is a matter of preference. It has been debated before in the GitHub issues. With the support for server variables and the additional reuse mechanisms in V3, I think there are sufficient facilities for creating clean API definitions without introducing nesting.

Nesting has the disadvantage of forcing a user who is trying to understand the complete picture of a resource URL to navigate up through all parent resources. In a large spec this can be particularly difficult.

I think it is unlikely that this kind of change will make it into the OAI specification any time soon.

All 4 comments

Supporting this style of spec structure is a matter of preference. It has been debated before in the GitHub issues. With the support for server variables and the additional reuse mechanisms in V3, I think there are sufficient facilities for creating clean API definitions without introducing nesting.

Nesting has the disadvantage of forcing a user who is trying to understand the complete picture of a resource URL to navigate up through all parent resources. In a large spec this can be particularly difficult.

I think it is unlikely that this kind of change will make it into the OAI specification any time soon.

I understand what are you talking about, but i think that a guy that wants to give a complete look on how api works use tools like swagger UI. I think that nested paths can give some advantages, the first one is avoid typo mispellings, but also create a logic order without tags (for example i know that all paths nested to /pets are paths related to pets management, and i can see this with indentation), somewhat like "paths ordering" inside spec. I don't know if i've been clear.

I understand all time problems for implement it inside OAI, it's just a proposal for the future :-)

Dupe of #647 and #1107

Closing as duplicate.

Was this page helpful?
0 / 5 - 0 ratings