Skip to content

Conversation

@pathob
Copy link
Contributor

@pathob pathob commented Jul 16, 2024

This BREAKING change removes the wrapping of collections into a collection model class.

Until today, a collection in JSON would always look like this:

{
  "entities": [
    { "key": "value" }
  ]
}

This was caused by model classes in the following style:

@XmlRootElement(name = BootstrAPI.ENTITIES)
public class EntitiesBean {

    @XmlElement
    private Collection<EntityBean> entities;

}

These classes now have fully been removed, and List<EntityBean> is
directly returned by all resources, so that the JSON for collections now
always looks like this:

[
  { "key": "value" }
]

@pathob pathob force-pushed the array-schema branch 3 times, most recently from ce3a439 to 0a481f3 Compare July 22, 2024 14:11
This BREAKING change removes the wrapping of collections into a
collection model class.

Until today, a collection in JSON would always look like this:

  ```json
  {
    "entities": [
      { "key": "value" }
    ]
  }
  ```

This was caused by model classes in the following style:

  ```java
  @XmlRootElement(name = BootstrAPI.ENTITIES)
  public class EntitiesBean {

      @xmlelement
      private Collection<EntityBean> entities;

  }
  ```

These classes now have fully been removed, and `List<EntityBean>` is
directly returned by all resources, so that the JSON for collections now
always looks like this:

  ```json
  [
    { "key": "value" }
  ]
  ```
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)
6.0% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

@pathob pathob merged commit 1c62795 into main Jul 22, 2024
@pathob pathob deleted the array-schema branch July 22, 2024 14:26
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

Successfully merging this pull request may close these issues.

2 participants