Forum Discussion

lnash94's avatar
lnash94
Occasional Contributor
3 years ago

What does it mean if we are having a wildcard "*/*" for request body in operation in OpenAPI

Hi Team,

I 'm having few concern regarding using  wildcard */*  in request body. 

scenario 01 : in here having wild card represent it can be  `image/png`, `image/svg`, `image/gif`, etc. and */* represents all types and is functionally equivalent to application/octet-stream. by referring OpenAPI spec here 

 

 

paths:
  /avatar:
    put:
      summary: Upload an avatar
      requestBody:
        content:
          image/*:    
            schema:
              type: string
              format: binary

 

 

scenario 02 : Having a wild card without giving schema type

 

requestBody:
        description: Any request
        content:
          "*/*":
            example:
              summary: "Any type of entity body"

 

 Cloud you please let me know is the scenario 02 also equivalent to scenario 01 or scenario 02 equivalent to any payload can be have as requestBody example `image/png`, `application/json`, `appilcation/xml` etc.?

No RepliesBe the first to reply