You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using a Spring Data REST version of Spring Boot's PetClinic application for playing around with the JSON Schema support. I noticed the following:
A property which represents a one-to-many association is of type string and format uri. However, it also contains the properties uniqueItems and items, which, according to the JSON Schema validation docs, only exist for array types. Below is an excerpt of the JSON Schema for the Owner class:
I agree that the current arrangement is invalid. But I don't agree on the arrangement you propose. For a association resource that's pointing to a collection, there's a single URI pointing to a resource that manages the collection association.
So we basically need to make sure that for resources, that are not embedded, we treat the property a string with format URI. For embedded resources (i.e. associations that do not point to a repository managed type) your suggested arrangement is valid and already works correctly (see PersistentEntityToJsonSchemaConverterUnitTests)
Dominik Münch opened DATAREST-690 and commented
I am using a Spring Data REST version of Spring Boot's PetClinic application for playing around with the JSON Schema support. I noticed the following:
A property which represents a one-to-many association is of type string and format uri. However, it also contains the properties uniqueItems and items, which, according to the JSON Schema validation docs, only exist for array types. Below is an excerpt of the JSON Schema for the Owner class:
I think the correct representation would be the following, do you agree?
Affects: 2.4 GA (Gosling)
Backported to: 2.4.1 (Gosling SR1)
The text was updated successfully, but these errors were encountered: