Revisit API error cases
wwerner opened this issue · 1 comments
wwerner commented
We're still experiencing intermittend hanging requests.
To approach this in a structured kind of way, I suggest writing a dedicated negative test suite for
- Trying to access non-existing resources (see also #96) -> 404
- Organization
- Unit
- Context
- Schema
- Schema Version (by
/organization
and/version/<reference>
) - Sources
- Syntactically invalid specifications (by
POST
,PATCH
,PUT
) -> 400 - Lifecycle state changes to invalid states -> 400
- Incomplete entities (by
POST
,PATCH
,PUT
) -> 400- Organization
- Unit
- Context
- Schema
- Schema Version (by
/organization
and/version/<reference>
)
- Invalid schema version updates
- Conflicting previous and current versions (gaps, same version, version no decreases) -> 409
- Incompatible specifciations in compatible version update (for patch and minor updates) -> 409
VaughnVernon commented
@wwerner A lot of this can be avoided by projecting a CQRS query model to eliminate navigational queries. Instead we can simple take all the path parameters and make a single composite key that resolves to the schema version (or whatever level the user wants).
Key: org:unit:context:schema:version
Value: schema-version-definition
We can create projections even though we are currently not event sourced. All of the events are already there, or you can use full-entity state-based projections.