SyneticNL / Hyral

Hypermedia oriented Resource API Layer
MIT License
34 stars 2 forks source link

Move Resource creation from responseNormalizer to repository to enable use for api's that don't return type #101

Closed jurcello closed 5 years ago

jurcello commented 5 years ago

Some api's like django rest framework don't include the resource type in the returned data by default. At this moment it is therefore not possible to create the proper responseNormalizer. In my opinion the responseNormalizer should return items where the minimum required structure is data and an id.

mnugter commented 5 years ago

Does it follow JSON:API specification or is it another format? If it's JSON:API the implementation for the server is incorrect, the spec states the id and type properties are mandatory.

https://jsonapi.org/format/#document-resource-objects

jurcello commented 5 years ago

It doesn't follow that specification. The point is that there are a lot of api's that doesn't adhere to the JSON:API specification. If support for that kind of API's should be possible, than resource creation has to be moved to a location where the resource type is known.

mnugter commented 5 years ago

Discussed offline:

mnugter commented 5 years ago

Will be part of the 1.2 release