Skip to content

Identification of resources #1318

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

Closed
gentlewind opened this issue Aug 15, 2017 · 3 comments
Closed

Identification of resources #1318

gentlewind opened this issue Aug 15, 2017 · 3 comments
Labels
Moved to Moonwalk Issues that can be closed or migrated as being addressed in Moonwalk

Comments

@gentlewind
Copy link

By OAI spec, we identify resources by Path templates. But in implementation of REST APIs, we most often identify resources by URIs. Obviously, there are gaps among Path Templates, URIs (RFC7320) and URI Templates (RFC6570).

Per framework capability, it might be difficult to use OAI to document code-first REST APIs sometimes. For instance,

  • Jersey requires to use path templates to design resource identifiers
  • Spring MVC allows much more flexible resource identification by combination of path, query params and headers.

What's OAI's view on resource identification by documentation?

@darrelmiller
Copy link
Member

You like picking the hard topics, don't you :-)

Personally, I would love to be able to describe a resource that is identified by an entire URI. I believe that sentiment is shared by the others in the TDC with the caveat of "not at any cost".

As you can see from this meta issue #574 we took a pretty big swing at addressing the many issues that are related to this topic. Somewhere in those issues (I searched but haven't found it yet) I make the assertion that I believe what we want is a deterministic algorithm for matching an instance URL to an operation description. Once you introduce optional path parameters, query parameters and discrimination by parameter value, it becomes challenging to identify an efficient algorithm.

However, if we could find a reliable, efficient way, to say this URI maps to this Operation without ambiguity, then I am convinced we could get it into the spec. My concern is that the only realistic way is with a "best fit" algorithm and I really don't want to go there unless all other options are exhausted.

@gentlewind
Copy link
Author

Thanks for the link to these good discussions. I don't have deep research on the URI matching algorithms, but in practice, ant style path matching is a reliable approach, AntPathMatcher.

@handrews handrews added the Moved to Moonwalk Issues that can be closed or migrated as being addressed in Moonwalk label Jan 27, 2024
@handrews
Copy link
Member

This wouldn't fit in 3.x, but might fit under Moonwalk's operation signatures principle. You might want to join discussions in that repo such as this one:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Moved to Moonwalk Issues that can be closed or migrated as being addressed in Moonwalk
Projects
None yet
Development

No branches or pull requests

3 participants