Hi All,

We are currently in the process of implementing Open API 3.0 support in API
Manager and as per the design discussions, APIM 2.2.0 will be supporting
both OpenAPI 3.0.0 and Swagger 2.0 specs. A resource definition of Open API
3.0.0 has some significant differences compared to a resource definition in
Swagger 2.0. Following are some of the major differences of Swagger 2.0 and
OpenAPI 3.0.0 spec based API resource definition.

   - '*body*' and '*formData*' parameter types are not available in OpenAPI
   3.0.0. Instead, the *requestBody* element has been introduced.
   - According to Swagger 2.0 spec, one can define a list of MIME types
   which the API resource can produce and consume. These configs are
   defines under *consumes *and *produces *elements of the API resource.
   But this config is no longer available in OpenAPI 3.0.0. Instead, MIME
   types are defined under *requestBody *and *response *elements.

OpenAPI 3.0.0 based resource definition is given below

paths:
  /testpath:
    get:
      responses:
        '200':
          description: OK
      parameters:
        - name: id
          in: query
          required: false
          schema:
            type: string
    post:
      responses:
        '200':
          description: OK
          content:
            *application/xml*:
              schema:
                type: array
                items:
                  type: string
      *requestBody*:
        content:
          *application/json:*
            schema:
              type: object
              properties:
                payload:
                  type: string
        description: Request Body

If we are implementing support for OpenAPI 3.0.0, we have to do some
changes to resource definition UI. (Has to remove consumes: and produces:
fields, has to remove body and formData from parameter types. Instead,
requestBody configuration functionality should be added). Since we have to
support both versions, we have to change the resource definition UI
rendering based on the swagger version. Shall we render a different UI with
above changes for OpenAPI 3.0.0 based API definitions? WDYT?



-- 
Thilini Shanika
Senior Software Engineer
WSO2, Inc.; http://wso2.com
20, Palmgrove Avenue, Colombo 3

E-mail: [email protected]
o
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to