You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Swagger-UI version: Whatever is the latest online (swagger hub)
Swagger/OpenAPI version: OpenAPI 3.0.1
Example Swagger/OpenAPI definition:
openapi: 3.0.1
/document/addDocument:
post:
summary: Adds a file to the system as a document object with the provided metadata
operationId: addDocument
requestBody:
content:
multipart/form-data:
schema:
type: object
properties:
file:
type: string
description: input stream of the file
format: binary
document:
$ref: '#/components/schemas/DocumentUploadData'
responses:
default:
description: default response
content:
'*/*': {}
security:
- qsessionauth: []
components:
schemas:
DocumentUploadData:
type: object
properties:
classificationId:
type: string
description: The id of the classification the document should be filed in
documentTypeId:
type: string
description: The id representing the type of the document
indexValues:
type: array
description: A list of custom data fields to put on the document
items:
$ref: '#/components/schemas/IndexValue'
description: Contains the classificationId, documentTypeId, and indexFields
for a document that is being uploaded.
I am trying to test out my OAS using the "try it" on swagger hub. I know my OAS works correctly as I have successfully executed it from a java client, however I would like to allow api consumers to try it directly from the swagger hub. My api request uploads a file and metadata for the file which is a json object "DocumentUploadData" in teh schema.
When I submit the call I get a response from my server stating that the DocumentUploadData object received by the server is null. I can see in the curl command that the type attribute for the document property is missing. If i add the attribute "type=application/json" to the curl command and run it then it is successful. I believe that the type property is not being read from the OAS spec. Or possibly I have my yaml written incorrectly.
I have tried it both with and without the "encoding" section.
encoding:
document:
contentType: application/json
and also tried manually defining my object instead of using a ref.
Example Swagger/OpenAPI definition:
I am trying to test out my OAS using the "try it" on swagger hub. I know my OAS works correctly as I have successfully executed it from a java client, however I would like to allow api consumers to try it directly from the swagger hub. My api request uploads a file and metadata for the file which is a json object "DocumentUploadData" in teh schema.
When I submit the call I get a response from my server stating that the DocumentUploadData object received by the server is null. I can see in the curl command that the type attribute for the document property is missing. If i add the attribute "type=application/json" to the curl command and run it then it is successful. I believe that the type property is not being read from the OAS spec. Or possibly I have my yaml written incorrectly.
I have tried it both with and without the "encoding" section.
and also tried manually defining my object instead of using a ref.
Curl command generated from swagger hub request:
Curl command that runs correctly when executed:
The text was updated successfully, but these errors were encountered: