Swagger Logo
  • Why Swagger?
    API Design API Development API Documentation API Testing API Mocking and Virtualization API Governance API Monitoring OpenAPI & Swagger
  • Tools
    • Pro

    • Open Source

    SwaggerHub

    Design & document all your REST APIs in one collaborative platform.

    SwaggerHub Enterprise

    Standardize your APIs with projects, style checks, and reusable domains.

    Swagger Inspector

    Test and generate API definitions from your browser in seconds.

    Swagger Codegen

    Generate server stubs and client SDKs from OpenAPI Specification definitions

    Swagger Editor

    API editor for designing APIs with the OpenAPI Specification.

    Swagger UI

    Visualize OpenAPI Specification definitions in an interactive UI.

    Explore all tools
  • Resources
    Resources
    OpenAPI Specification Docs Blog Support
  •  
  • Sign In
  • Try Free

OAS 3 This guide is for OpenAPI 3.0.

Data Models (Schemas)

OpenAPI 3.0 data types are based on an extended subset JSON Schema Specification Wright Draft 00 (aka Draft 5). The data types are described using a Schema object. To learn how to model various data types, see the following topics:
  • Data Types
  • Enums
  • Dictionaries, Hashmaps, Associative Arrays
  • oneOf, anyOf, allOf, not
  • Inheritance and Polymorphism
  • Representing XML
  • Supported JSON Schema Keywords

  

Did not find what you were looking for? Ask the community
Found a mistake? Let us know

  • SwaggerHub
  • Swagger Inspector
  • Open Source Tools
  • OpenAPI Guide
    • What Is OpenAPI?
    • Basic Structure
    • API Server and Base Path
    • Media Types
    • Paths and Operations
    • Describing Parameters
    • Parameter Serialization
    • Describing Request Body
    • Describing Responses
    • Data Models (Schemas)
      • Data Types
      • Enums
      • Dictionaries, Hashmaps, Associative Arrays
      • oneOf, anyOf, allOf, not
      • Inheritance and Polymorphism
      • Representing XML
      • Supported JSON Schema Keywords
    • Adding Examples
    • Authentication
    • Links
    • Callbacks
    • Components Section
    • Using $ref
    • API General Info
    • Grouping Operations With Tags
    • OpenAPI Extensions
    • 2.0

Swagger Logo
Swagger Open Source
  • Open Source License
  • Swagger Forum
  • Swagger IRC
  • Swagger Community
  • Swagger Projects
Swagger
  • About Swagger
  • Blog
  • Support
  • News
  • Contact Us
Pro Tools
  • SwaggerHub
  • Swagger Inspector
  • SwaggerHub Enterprise
  • SwaggerHub vs OSS
  • SwaggerHub Integrations
Resources
  • OpenAPI Specification
  • Resources
  • Open Source Docs
  • Swagger Inspector Docs
  • SwaggerHub Docs
Explore SmartBear Products
  • AlertSite
  • AQTime Pro
  • BitBar
  • Bugsnag
  • Capture for Jira
  • Collaborator
  • Cucumber for Jira
  • CucumberStudio
  • Cucumber Open
  • LoadNinja
  • Pact
  • Pactflow
  • ReadyAPI
  • SoapUI
  • Swagger
  • SwaggerHub
  • TestComplete
  • TestEngine
  • TestLeft
  • Zephyr
  • About Us
  • |
  • Careers
  • |
  • Solutions
  • |
  • Partners

  • Contact Us
  • |
  • +1 617-684-2600 USA
  • |
  • +353 91 398300 EUR
  • |
  • +61 391929960 AUS
  • |
© 2023 SmartBear Software. All Rights Reserved.
  • Privacy
  • |
  • Terms of Use
  • |
  • Site Map
  • |
  • Website Terms of Use
  • |
  • Security