Skip to content

Empty HAL-Forms options inline attribute should be serialized #2438

@reda-alaoui

Description

@reda-alaoui

Currently, when HalFormsOptions.Inline#getInline is empty, the JSON inline attribute is excluded from the representation. This is because of:

If we take a look at HAL-FORMS specification, we can read what follows:

If the inline attribute is missing or unparseable and the link (see link) attribute is missing or unparseable, then the options element SHOULD be ignored.

Therefore, IMO, from the spec POV, inline has 3 states:

  • missing
  • empty
  • non empty

Spring HATEOAS current behavior reduces this to 2 states:

  • missing
  • non empty

I think Spring HATEOAS should fix this to correctly represent the 3 states of the specification.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions