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

Field "schema" is required #305

Closed
javiertrejo opened this issue Apr 21, 2016 · 2 comments
Closed

Field "schema" is required #305

javiertrejo opened this issue Apr 21, 2016 · 2 comments

Comments

@javiertrejo
Copy link

When i run the command-line swagger to generate the JSON file the program return this:

[INFO] Field "schema" is required when @swg\Parameter(name="data",in="body") is in "body" in /opt/BM3/api/src/Encompass/Sources/Screen.php on line 173

This is not correct because, when the parameter is in="body" and the type is "file" the schema is not necesary.
@SWG\Parameter(description="contenido del archivo", in="body", name="data", required=true, type="file" ),

@bfanger
Copy link
Collaborator

bfanger commented Apr 21, 2016

Thanks, but the spec doesn't mention this exception, shouldn't the @SWG\Parameter->in be formData when the @SWG\Parameter->type='file' ?

OAI/OpenAPI-Specification#326 suggests using the following as a workaround:

schema: {
   "type": "string",
   "format": "binary",
}

@javiertrejo
Copy link
Author

Thanks for the explanation. The "error" was not in the swagger generator. Is in the swagger-ui and how display the mentioned workaround.

Regards,

bfanger added a commit that referenced this issue May 27, 2016
 - Beter validation of type="file" #305
 - Augment Operations summary and description based on the comment. #293
 - Bugfixes #300
 - Add support for xml (and externalDocs and properties) inside a @swg\Items. #279
 - Nested properties are no longer injected into the Definition #297
 - Fixed nesting issue with verbose property notation #297
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