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

Clashing (identically-defined) pathItem keys #1

Open
cbornet opened this issue Nov 11, 2020 · 2 comments
Open

Clashing (identically-defined) pathItem keys #1

cbornet opened this issue Nov 11, 2020 · 2 comments

Comments

@cbornet
Copy link
Owner

cbornet commented Nov 11, 2020

Comment from @MikeRalphson on the blog post:

If you use single value enums, won't you hit the problem of clashing (identically-defined) pathItem keys? How would you distinguish them? Hence my suggestion to dynamically build the enum lists based on allowable values for the parameter (maybe within a page range etc to prevent the list being too large).

@cbornet
Copy link
Owner Author

cbornet commented Nov 11, 2020

That's a problem of OAI using a map for pathItems. I could have chosen to directly reference an array of pathItems in controls but then it wouldn't be 100% compatible with existing tools and libs (eg. swagger-ui) which is I think a strength ot the OHM format. Eg in the paging implementation, you can have 2 links with the same path+method (eg. "first page" and "previous page"). I worked around it by setting a fragment in the path to distinguish the 2 affordances. This fragment being ignored server-side. The problem of an enum list is that if you have several params, you don't know which combination of enum is allowed. And I don't see how to associate an affordance (eg. "first page") to an enum value.

@cbornet
Copy link
Owner Author

cbornet commented Nov 16, 2020

Swagger-ui currently doesn't support fragments : swagger-api/swagger-ui#6620
So the OHM-browser has been patched to remove the fragment before doing the request.

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

1 participant