backstage

Форк
0
/
openapi-example-api.yaml 
124 строки · 3.2 Кб
1
apiVersion: backstage.io/v1alpha1
2
kind: API
3
metadata:
4
  name: petstore
5
  description: The petstore API
6
  tags:
7
    - store
8
    - rest
9
spec:
10
  type: openapi
11
  lifecycle: experimental
12
  owner: team-c
13
  definition: |
14
    openapi: "3.0.0"
15
    info:
16
      version: 1.0.0
17
      title: Swagger Petstore
18
      license:
19
        name: MIT
20
    servers:
21
      - url: http://petstore.swagger.io/v1
22
    paths:
23
      /pets:
24
        get:
25
          summary: List all pets
26
          operationId: listPets
27
          tags:
28
            - pets
29
          parameters:
30
            - name: limit
31
              in: query
32
              description: How many items to return at one time (max 100)
33
              required: false
34
              schema:
35
                type: integer
36
                format: int32
37
          responses:
38
            '200':
39
              description: A paged array of pets
40
              headers:
41
                x-next:
42
                  description: A link to the next page of responses
43
                  schema:
44
                    type: string
45
              content:
46
                application/json:
47
                  schema:
48
                    $ref: "#/components/schemas/Pets"
49
            default:
50
              description: unexpected error
51
              content:
52
                application/json:
53
                  schema:
54
                    $ref: "#/components/schemas/Error"
55
        post:
56
          summary: Create a pet
57
          operationId: createPets
58
          tags:
59
            - pets
60
          responses:
61
            '201':
62
              description: Null response
63
            default:
64
              description: unexpected error
65
              content:
66
                application/json:
67
                  schema:
68
                    $ref: "#/components/schemas/Error"
69
      /pets/{petId}:
70
        get:
71
          summary: Info for a specific pet
72
          operationId: showPetById
73
          tags:
74
            - pets
75
          parameters:
76
            - name: petId
77
              in: path
78
              required: true
79
              description: The id of the pet to retrieve
80
              schema:
81
                type: string
82
          responses:
83
            '200':
84
              description: Expected response to a valid request
85
              content:
86
                application/json:
87
                  schema:
88
                    $ref: "#/components/schemas/Pet"
89
            default:
90
              description: unexpected error
91
              content:
92
                application/json:
93
                  schema:
94
                    $ref: "#/components/schemas/Error"
95
    components:
96
      schemas:
97
        Pet:
98
          type: object
99
          required:
100
            - id
101
            - name
102
          properties:
103
            id:
104
              type: integer
105
              format: int64
106
            name:
107
              type: string
108
            tag:
109
              type: string
110
        Pets:
111
          type: array
112
          items:
113
            $ref: "#/components/schemas/Pet"
114
        Error:
115
          type: object
116
          required:
117
            - code
118
            - message
119
          properties:
120
            code:
121
              type: integer
122
              format: int32
123
            message:
124
              type: string
125

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.