Acceso a Datos

2º DAM - Curso 2022-2023

User Tools

Site Tools


apuntes:openapi

Diseño de APIs: OpenAPI Specification

Enfoque API First

OpenAPI Specification

myapi.yaml
    openapi: 3.0.0
    info:
      title: Sample API
      description: Optional multiline or single-line description in [CommonMark](http://commonmark.org/help/) or HTML.
      version: 0.1.9
    servers:
      - url: http://api.example.com/v1
        description: Optional server description, e.g. Main (production) server
      - url: http://staging-api.example.com
        description: Optional server description, e.g. Internal staging server for testing
    paths:
      /users:
        get:
          summary: Returns a list of users.
          description: Optional extended description in CommonMark or HTML.
          responses:
            '200':    # status code
              description: A JSON array of user names
              content:
                application/json:
                  schema: 
                    type: array
                    items: 
                      type: string

Generar el código: Swagger Codegen


© 2022-2022 Santiago Faci

apuntes/openapi.txt · Last modified: 13/02/2022 17:50 by Santiago Faci