DEV Community

Discussion on: OHM, the mediatype for REST/HATEOAS powered by OpenAPI

 
cbornet profile image
Christophe Bornet

I blogged about returning partial OAS documents

"Great minds think alike" 😃

If you use single value enums, won't you hit the problem of clashing (identically-defined) pathItem keys?

Yes. 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.
I opened github.com/cbornet/ohm/issues/1 to track this issue.

Fielding (2000) says: (In section 6.5.2 'HTTP is not RPC')

If Roy says it, I guess this is it ... 😅 . But we still call procedures remotely...

"HEAD" and "OPTIONS" are the two obvious non-verb standard HTTP methods. :)

I should get some sleep 🤦...