Fix DTS endpoints to pass schemathesis tests - #379
Open
cmil wants to merge 1 commit into
Open
Conversation
These DTS-specific fixes were removed from #370: - api.yaml: minLength: 1 on the resource parameter of /dts/navigation and /dts/document; clarify the /dts/collection id parameter description (now collection-only, since no document is returned by this endpoint). - modules/dts.xqm: - ddts:collections: validate the nav parameter, reject anything other than 'parents' with 400. - local:corpus-or-play-collection-by-id: return 404 instead of 400 for an unknown id (a valid-format id that does not identify a collection). - local:child-readable-collection-with-parent-by-id: return 404 when the play id does not exist in the database, instead of a 500 cardinality error. - ddts:document and ddts:navigation: treat ref as taking precedence over start/end; ignore incomplete ranges (only one of start/end provided); default navigation to down=1 when no navigation parameter is specified. Removes the ref+start+end 400 branch, which is now handled by the precedence rule.
Merging this PR will leave 7 of 36 operations untested. Please review.
❌ Untested (7)
🔴 Tested (29)
19 more
Powered by TraceCov v0.22.0 schemathesis 4.22.4 | http://localhost:8081/exist/restxq/v1/openapi.yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on top of #370. This branch restores the DTS-specific fixes that were removed from #370 while it was refocused on the schemathesis upgrade alone.
Summary
modules/dts.xqm— server-side leniency fixes for/dts/collection,/dts/document, and/dts/navigationso schema-compliant requests are no longer rejected with 400/500:ddts:collectionsvalidates thenavparameter (400 for values other thanparents).local:corpus-or-play-collection-by-idreturns 404 instead of 400 when the id does not identify a known collection.local:child-readable-collection-with-parent-by-idreturns 404 when the play id is unknown, replacing the previous 500 cardinality error.ddts:documentandddts:navigationtreatrefas taking precedence overstart/end, silently ignore incompletestart/endranges, and default navigation todown=1when no navigation parameter is provided.api.yaml—minLength: 1on theresourceparameter of/dts/navigationand/dts/document; tightened description of the/dts/collectionidparameter.These fixes are conservative leniency patches meant to keep the current implementation passing the schemathesis suite until we update the implementation to comply with DTS version 1.0. They should be reviewed as an interim measure.