Skip to content

Differences Between OpenAPI 2.0 and 3.0 #9

@ntk148v

Description

@ntk148v

title: Differences Between OpenAPI 2.0 and 3.0
path: web-dev/openapi-2-and-3.md

Specification Restructured to Increase Reusability

image

Extended JSON Schema Support

The 3.0 release includes extended support for JSON Schema, which means you can use more JSON Schema keywords than with version 2.0. Some keywords supported in version 3.0 are handled slightly differently than in JSON Schema, including:

  • oneOf
  • anyOf
  • allOf

OpenAPI 2.0 does not support the oneOf or anyOf keywords, but you can use these keywords with version 3.0.

Examples Overhauled for Easy Reusability

Improved Parameter Descriptions

Version 3.0 includes improvements to parameter descriptions. The body and formData parameter types have been removed and replaced with requestBody. The specification supports arrays and objects in operation parameters, and you can specify the method of serialization. Operation parameters include path, query, header, and cookie.

More

Source: https://blog.stoplight.io/difference-between-open-v2-v3-v31

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions