Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swagger.json schema contains zero required key/value pairs #2

Open
anthonypants opened this issue Jul 20, 2018 · 1 comment
Open

swagger.json schema contains zero required key/value pairs #2

anthonypants opened this issue Jul 20, 2018 · 1 comment

Comments

@anthonypants
Copy link

A POST to /channels requires an associated JSON string in order to create a channel. This JSON string is, itself, a required field. However, the schema does not specify which, if any, key/value pairs in the JSON block are required. All of these settings appear to be optional, because none of them are defined as required:

Channel {
id (string, optional),
nextMetaDataId (integer, optional),
name (string, optional),
description (string, optional),
revision (integer, optional),
sourceConnector (Connector, optional),
destinationConnectors (Array[Connector], optional),
preprocessingScript (string, optional),
postprocessingScript (string, optional),
deployScript (string, optional),
undeployScript (string, optional),
properties (ChannelProperties, optional),
exportData (ChannelExportData, optional),
enabledDestinationConnectors (Array[Connector], optional),
purgedProperties (object, optional)
}

This is the case for all JSON content in swagger.json -- the JSON block is "required", but none of the k/v pairs within the JSON block are marked required, and therefore they are each "optional".

@narupley
Copy link
Collaborator

Currently the API only supports XML for most routes. The API documentation page (built with SwaggerUI) does show the correct expected Content-Type (application/xml). But the "sample model" to the side is still shown as JSON, I think just because that's what SwaggerUI does by default. Not sure if there's a way to switch that to show XML sample models instead.

The swagger.json/yaml is actually auto-generated from Swagger's JAX-RS/Jersey servlet implementation. I wonder if there are Swagger-specific annotations that we could put on the Java model objects themselves (like Channel) so that required properties can be shown.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants