Skip to content

Commit 32a56df

Browse files
authored
chore: Bundle and split the sample to get updated output (#100)
keep the README files, and allow the full `info.description` since ref isn't valid here
1 parent 3b19360 commit 32a56df

File tree

13 files changed

+59
-88
lines changed

13 files changed

+59
-88
lines changed

openapi/components/responses/Problem.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ description: Problem
22
content:
33
application/problem+json:
44
schema:
5-
$ref: ../schemas/Problem.yaml
5+
$ref: ../schemas/Problem.yaml

openapi/components/schemas/Problem.yaml

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,33 @@ type: object
22
additionalProperties: true
33
minProperties: 1
44
description: >-
5-
The Problem Details JSON Object [[RFC7807](https://tools.ietf.org/html/rfc7807)].
5+
The Problem Details JSON Object
6+
[[RFC7807](https://tools.ietf.org/html/rfc7807)].
67
properties:
78
type:
89
type: string
910
description: >-
10-
A URI reference [[RFC3986](https://tools.ietf.org/html/rfc3986)] that identifies the problem type.
11-
It should provide human-readable documentation for the problem type.
12-
When this member is not present, its value is assumed to be "about:blank".
11+
A URI reference [[RFC3986](https://tools.ietf.org/html/rfc3986)] that
12+
identifies the problem type. It should provide human-readable
13+
documentation for the problem type. When this member is not present, its
14+
value is assumed to be "about:blank".
1315
format: uri
1416
title:
1517
type: string
1618
description: >-
17-
A short, human-readable summary of the problem type.
18-
It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization.
19+
A short, human-readable summary of the problem type. It SHOULD NOT change
20+
from occurrence to occurrence of the problem, except for purposes of
21+
localization.
1922
status:
2023
type: integer
2124
description: The HTTP status code.
2225
minimum: 400
2326
maximum: 599
2427
detail:
2528
type: string
26-
description: >-
27-
A human-readable explanation specific to this
28-
occurrence of the problem.
29+
description: A human-readable explanation specific to this occurrence of the problem.
2930
instance:
3031
type: string
3132
description: >-
32-
A URI reference that identifies the specific
33-
occurrence of the problem. It may or may not yield further
34-
information if dereferenced.
35-
36-
# Consumers SHOULD NOT parse the "detail" member for information;
37-
# extensions are more suitable and less error-prone ways to obtain such
38-
# information.
39-
# See: https://datatracker.ietf.org/doc/html/rfc7807#section-3.2
33+
A URI reference that identifies the specific occurrence of the problem.
34+
It may or may not yield further information if dereferenced.

openapi/components/schemas/Schema.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ properties:
4242
description: Property name's description (type is string or null)
4343
type:
4444
- string
45-
- "null"
45+
- 'null'
4646
examples:
4747
- example
4848
stringEnumValues:

openapi/components/securitySchemes/api_key.yaml

Lines changed: 0 additions & 3 deletions
This file was deleted.

openapi/components/securitySchemes/basic_auth.yaml

Lines changed: 0 additions & 2 deletions
This file was deleted.

openapi/components/securitySchemes/main_auth.yaml

Lines changed: 0 additions & 7 deletions
This file was deleted.

openapi/info-description.md

Lines changed: 0 additions & 37 deletions
This file was deleted.

openapi/openapi.yaml

Lines changed: 40 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,42 @@ openapi: 3.1.0
22
info:
33
version: 1.0.0
44
title: Example.com
5-
termsOfService: 'https://example.com/terms/'
5+
termsOfService: https://example.com/terms/
66
contact:
77
8-
url: 'http://example.com/contact'
8+
url: http://example.com/contact
99
license:
1010
name: Apache 2.0
11-
url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
11+
url: http://www.apache.org/licenses/LICENSE-2.0.html
1212
x-logo:
13-
url: 'https://redocly.github.io/openapi-template/logo.png'
14-
description:
15-
$ref: ./info-description.md
13+
url: https://redocly.github.io/openapi-template/logo.png
14+
description: >
15+
This is an **example** API to demonstrate features of the OpenAPI
16+
specification.
17+
18+
# Introduction
19+
20+
This API definition is intended to to be a good starting point for
21+
describing your API in [OpenAPI/Swagger
22+
format](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md).
23+
24+
It also demonstrates features of the
25+
[create-openapi-repo](https://github.com/Redocly/create-openapi-repo) tool
26+
and the [Redoc](https://github.com/Redocly/Redoc) documentation engine. Beyond
27+
the standard OpenAPI syntax, we use a few
28+
[vendor extensions](https://github.com/Redocly/Redoc/blob/master/docs/redoc-vendor-extensions.md).
29+
30+
# OpenAPI Specification
31+
32+
The goal of The OpenAPI Specification is to define a standard, language-agnostic interface to REST APIs which
33+
allows both humans and computers to discover and understand the capabilities
34+
of the service without access to source
35+
code, documentation, or through network traffic inspection. When properly
36+
defined via OpenAPI, a consumer can
37+
understand and interact with the remote service with a minimal amount of
38+
implementation logic. Similar to what
39+
interfaces have done for lower-level programming, OpenAPI removes the
40+
guesswork in calling the service.
1641
tags:
1742
- name: Echo
1843
description: Example echo operations.
@@ -21,31 +46,31 @@ tags:
2146
- name: Tag
2247
description: This is a tag description.
2348
servers:
24-
- url: 'https://{tenant}/api/v1'
49+
- url: https://{tenant}/api/v1
2550
variables:
2651
tenant:
2752
default: www
2853
description: Your tenant id
29-
- url: 'https://example.com/api/v1'
54+
- url: https://example.com/api/v1
3055
paths:
31-
'/users/{username}':
32-
$ref: 'paths/users_{username}.yaml'
56+
/users/{username}:
57+
$ref: paths/users_{username}.yaml
3358
/echo:
3459
$ref: paths/echo.yaml
3560
/pathItem:
36-
$ref: paths/path-item.yaml
61+
$ref: paths/pathItem.yaml
3762
/pathItemWithExamples:
38-
$ref: paths/path-item-with-examples.yaml
63+
$ref: paths/pathItemWithExamples.yaml
3964
components:
4065
securitySchemes:
4166
main_auth:
4267
type: oauth2
4368
flows:
4469
implicit:
45-
authorizationUrl: 'http://example.com/api/oauth/dialog'
70+
authorizationUrl: http://example.com/api/oauth/dialog
4671
scopes:
47-
'read:users': read users info
48-
'write:users': modify or remove users
72+
read:users: read users info
73+
write:users: modify or remove users
4974
api_key:
5075
type: apiKey
5176
in: header

openapi/paths/echo.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ post:
3131
text/csv:
3232
schema:
3333
type: string
34-
'400':
34+
'400':
3535
description: Unauthorized
3636
requestBody:
3737
content:
@@ -46,9 +46,9 @@ post:
4646
description: Echo payload
4747
required: true
4848
x-codeSamples:
49-
- lang: "C#"
49+
- lang: C#
5050
source:
51-
$ref: "../code_samples/csharp/echo/post.cs"
51+
$ref: ../code_samples/C_sharp/echo/post.cs
5252
- lang: PHP
5353
source:
5454
$ref: ../code_samples/PHP/echo/post.php

0 commit comments

Comments
 (0)