Skip to content

Hateoas CollectionModel - Do we follow HAL or OpenAPI 3.0 specification? #446

Closed
@chrisatrotter

Description

@chrisatrotter

When creating a Hateoas CollectionModel with springdoc-openapi, then the naming "content" and "links" is given within the Schema as specified by OpenAPI 3.0. However, these names do not follow the convention of the HAL Specification which is "_embedded" and "_links".

OpenAPI 3.0 Specification
image

HAL Specification
image

Describe the solution you'd like

It would be nice to change the OpenAPI 3.0 Specification of "content" and "links" to "_embedded" and "_links". It would be more natural to follow the HAL Specification as this is specific for Hateoas 1.0. Result shown below:

"components":{
    "schemas": {
      "CollectionModel«EntityModel«RelatedCode»»":{ 
         "type":"object",
         "properties":{ 
            "_embedded":{ 
               ...
            },
            "_links":{ 
               ...
            }
         },
         "title":"CollectionModel«EntityModel«RelatedCode»»"
      }
   }
}

Links to the specifications

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions