-
Notifications
You must be signed in to change notification settings - Fork 102
/
openapi.yaml
80 lines (75 loc) · 2.53 KB
/
openapi.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
openapi: 3.1.0
info:
version: 1.0.0
title: Example.com
termsOfService: https://example.com/terms/
contact:
email: contact@example.com
url: http://example.com/contact
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
x-logo:
url: https://redocly.github.io/openapi-template/logo.png
description: >
This is an **example** API to demonstrate features of the OpenAPI
specification.
# Introduction
This API definition is intended to to be a good starting point for
describing your API in [OpenAPI/Swagger
format](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md).
It also demonstrates features of the
[create-openapi-repo](https://github.com/Redocly/create-openapi-repo) tool
and the [Redoc](https://github.com/Redocly/Redoc) documentation engine. Beyond
the standard OpenAPI syntax, we use a few
[vendor extensions](https://github.com/Redocly/Redoc/blob/master/docs/redoc-vendor-extensions.md).
# OpenAPI Specification
The goal of The OpenAPI Specification is to define a standard, language-agnostic interface to REST APIs which
allows both humans and computers to discover and understand the capabilities
of the service without access to source
code, documentation, or through network traffic inspection. When properly
defined via OpenAPI, a consumer can
understand and interact with the remote service with a minimal amount of
implementation logic. Similar to what
interfaces have done for lower-level programming, OpenAPI removes the
guesswork in calling the service.
tags:
- name: Echo
description: Example echo operations.
- name: User
description: Operations about users.
- name: Tag
description: This is a tag description.
servers:
- url: https://{tenant}/api/v1
variables:
tenant:
default: www
description: Your tenant id
- url: https://example.com/api/v1
paths:
/users/{username}:
$ref: paths/users_{username}.yaml
/echo:
$ref: paths/echo.yaml
/pathItem:
$ref: paths/pathItem.yaml
/pathItemWithExamples:
$ref: paths/pathItemWithExamples.yaml
components:
securitySchemes:
main_auth:
type: oauth2
flows:
implicit:
authorizationUrl: http://example.com/api/oauth/dialog
scopes:
read:users: read users info
write:users: modify or remove users
api_key:
type: apiKey
in: header
name: api_key
basic_auth:
type: http
scheme: basic