Skip to content

Commit 640bcc4

Browse files
committed
Improve docs
1 parent 03ec4da commit 640bcc4

File tree

4 files changed

+20
-14
lines changed

4 files changed

+20
-14
lines changed

README.md

+14-12
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
# Generate Code Snippets from an OpenAPI specification
22

3-
This Github Action takes an OpenAPI spec, generates code samples for each operation and adds them to the spec using [the `x-code-samples` extension](https://redocly.com/docs/api-reference-docs/specification-extensions/x-code-samples).
4-
If you [specified `examples` in your endpoint](https://swagger.io/docs/specification/adding-examples/), it takes the first example as the payload when generating snippets. If there is no example, the payload will be empty/`null`.
3+
This GitHub Action takes an OpenAPI spec, generates code samples for each
4+
operation and adds them to the spec using
5+
[the `x-code-samples` extension](https://redocly.com/docs/api-reference-docs/specification-extensions/x-code-samples).
6+
7+
If you
8+
[specified `examples` in your endpoint](https://swagger.io/docs/specification/adding-examples/),
9+
it takes the first example as the payload when generating snippets. If there is
10+
no example, the payload will be empty/`null`.
511

612
The following languages are supported:
713

@@ -28,16 +34,11 @@ The following languages are supported:
2834

2935
The results look like this.
3036

31-
![readme.com](./docs/readme.png)
32-
_readme.com_
33-
34-
![rapidoc](./docs/rapidoc.png)
35-
_RapiDoc_
36-
37-
![redoc](./docs/redoc.png)
38-
_Redoc_
37+
![readme.com](./docs/readme.png) _readme.com_
3938

39+
![rapidoc](./docs/rapidoc.png) _RapiDoc_
4040

41+
![redoc](./docs/redoc.png) _Redoc_
4142

4243
## Prerequisites / Inputs
4344

@@ -48,10 +49,11 @@ _Redoc_
4849

4950
## Instructions
5051

51-
Add a Github Action in your workflow, passing the input spec file (json or yaml), the desired output file location (json) and, optionally, the list of languages to generate snippets for.
52+
Add a GitHub Action in your workflow, passing the input spec file (json or
53+
yaml), the desired output file location (json) and, optionally, the list of
54+
languages to generate snippets for.
5255

5356
```yaml
54-
5557
- name: Generate Code Samples
5658
uses: grid-x/api-spec-snippets-generator-action@v6
5759
with:

badges/coverage.svg

+1-1
Loading

dist/index.js

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)