accept body parameters of the form application/subtype+json #1413
+71
−11
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.
To support SCIM support, dropshot needs to be able to accept requests whose
content-type
header is specificallyapplication/scim+json
. Taking this apart, this MIME type means "the SCIM protocol, serialized as JSON". One can think of it as strictly a subset of JSON i.e. all messages are in the SCIM protocol, but all are also valid JSON.We have several options for how to address this. It would seem reasonable and robust to allow an
ApiDescription
(i.e. a collection of endpoints) for which we say "the input and response bodies are all SCIM protocol so application/scim+json is applicable" (and that might be inclusive or exclusive of application/json i.e. thescim+
part might be optional). We could include this in the OpenAPI output to document the content type for body parameters and responses. This idea, however, requires something along the lines of what's imagined in PR #922 and hasn't been completed.Instead, this PR implements a more expedient approach: treat
content-type: application/X+json
asapplication/json
. This isn't wrong per se as the former is a subset of the latter, but it doesn't allow a consumer to impose a distinction between the two.Closes #1383