You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TheElysiaschemabuilder, `t`, givescompile-timeandruntimetype safety. ItalsoregistersthemodelasareusableOpenAPI [ComponentsObject](https://swagger.io/specification/v3/#components-object) schema, which you can see at the bottom of your OpenAPI document:
246
+
TheElysiaschemabuilder, `t`, givescompile-timeandruntimetype safety. ItalsoregistersthemodelasareusableOpenAPI [ComponentsObject](https://spec.openapis.org/oas/v3.1.2.html#components-object) schema, which you can see at the bottom of your OpenAPI document:
247
247
248
248
```json
249
249
"components": {
@@ -357,7 +357,7 @@ responses: {
357
357
},
358
358
```
359
359
360
-
The [ResponsesObject](https://swagger.io/specification/#responses-object) is used to list the possible responses returned from the POST request. There is one possible response listed - a successful response. This response has a [`schema`](https://swagger.io/specification/#schema-object) that defines the content of the response. The `id` schema is referenced using [`$ref`](https://swagger.io/specification/#reference-object), the reference identifier that specifies the URI location of the value being referenced. Let's define this `id` model.
360
+
The [ResponsesObject](https://spec.openapis.org/oas/v3.1.2.html#responses-object) is used to list the possible responses returned from the POST request. There is one possible response listed - a successful response. This response has a [`schema`](https://spec.openapis.org/oas/v3.1.2.html#schema-object) that defines the content of the response. The `id` schema is referenced using [`$ref`](https://spec.openapis.org/oas/v3.1.2.html#reference-object), the reference identifier that specifies the URI location of the value being referenced. Let's define this `id` model.
@@ -495,7 +495,7 @@ Add the following `tags` array to the configuration object of the `swagger` plug
495
495
)
496
496
```
497
497
498
-
Thisaddsa`tags`arraytotherootOpenAPIdocumentobject. Intheabovecode, weaddmetadatatothetagbypassingina [TagObject](https://swagger.io/specification/#tag-object) (instead of a string) to the tag array item.
498
+
Thisaddsa`tags`arraytotherootOpenAPIdocumentobject. Intheabovecode, weaddmetadatatothetagbypassingina [TagObject](https://spec.openapis.org/oas/v3.1.2.html#tag-object) (instead of a string) to the tag array item.
499
499
500
500
Afteraddingtagstoyourroutes, you'll see that they are organized by tags in Scalar:
Copy file name to clipboardExpand all lines: openapi/frameworks/fastify.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -105,7 +105,7 @@ The option to output YAML is [brand new](https://github.com/fastify/fastify-cli/
105
105
106
106
## Supported OpenAPI Versions in Fastify and Speakeasy
107
107
108
-
Fastify can generate OpenAPI specifications in [OpenAPI version 2.0](https://swagger.io/specification/v2/) (formerly known as _Swagger_) or [OpenAPI version 3.0.3](https://swagger.io/specification/v3/).
108
+
Fastify can generate OpenAPI specifications in [OpenAPI version 2.0](https://spec.openapis.org/oas/v2.0.html) (formerly known as _Swagger_) or [OpenAPI version 3.0.3](https://spec.openapis.org/oas/v3.1.2.html).
Copy file name to clipboardExpand all lines: openapi/frameworks/nestjs.mdx
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -93,7 +93,7 @@ import { apiReference } from '@scalar/nestjs-api-reference';
93
93
94
94
In the above code:
95
95
96
-
- The `SwaggerModule.createDocument` method returns a serializable [OpenAPI document](https://swagger.io/specification/#openapi-document) object that we'll convert to an OpenAPI YAML document file using JS-YAML.
96
+
- The `SwaggerModule.createDocument` method returns a serializable [OpenAPI document](https://spec.openapis.org/oas/v3.0.4.html#openapi-document) object that we'll convert to an OpenAPI YAML document file using JS-YAML.
97
97
- We use `DocumentBuilder` to create the base structure of the OpenAPI document. The [`DocumentBuilder` methods](https://github.com/nestjs/swagger/blob/master/lib/document-builder.ts) set the properties that identify the purpose and owner of the document, such as the title and description properties.
98
98
- We use the `createDocument()` method to define the API routes by passing in two arguments: the `app` instance and the document `config`. We can also provide a third argument, [`SwaggerDocumentOptions`](https://docs.nestjs.com/openapi/introduction#document-options).
99
99
- We use `SwaggerModule.setup()` to expose the OpenAPI document at `/api-yaml` for the YAML format and `/api-json` for the JSON format.
@@ -168,7 +168,7 @@ Speakeasy currently supports the OpenAPI Specification versions 3.0.x and 3.1.x.
168
168
169
169
## Adding OpenAPI `info` in NestJS
170
170
171
-
Let's improve the OpenAPI document by better describing it. We'll add more fields to the [info object](https://swagger.io/specification/#info-object), which contains metadata about the API.
171
+
Let's improve the OpenAPI document by better describing it. We'll add more fields to the [info object](https://spec.openapis.org/oas/v3.0.4.html#info-object), which contains metadata about the API.
172
172
173
173
Add the following `DocumentBuilder` methods to the `config` section of the document (`main.ts`) to supply more data about the API:
174
174
@@ -262,7 +262,7 @@ Add the following OpenAPI decorators to the `@Post()` route handler:
The `@ApiBody()` and `@ApiOkResponse` decorators use the [Schema Object](https://swagger.io/specification/#schemaObject), which defines the input and output data types. The allowed data types are defined by the `Cat` and `Dog` data transfer objects (DTO) schema. A DTO schema defines how data will be sent over the network.
265
+
The `@ApiBody()` and `@ApiOkResponse` decorators use the [Schema Object](https://spec.openapis.org/oas/v3.0.4.html#schemaObject), which defines the input and output data types. The allowed data types are defined by the `Cat` and `Dog` data transfer objects (DTO) schema. A DTO schema defines how data will be sent over the network.
266
266
267
267
Now, run the NestJS HTTP server and open `http://localhost:3000/api-yaml/`. You'll see the OpenAPI endpoints description is more fleshed out.
268
268
@@ -320,7 +320,7 @@ It should now look as follows:
320
320
description: Forbidden
321
321
```
322
322
323
-
The [Reference Object](https://swagger.io/specification/#reference-object) (`$ref`) is a reference identifier that specifies the location, as a URI, of the value being referenced. It references the `schemas` field of the [Components Object](https://swagger.io/specification/#components-object), which holds reusable schema objects.
323
+
The [Reference Object](https://spec.openapis.org/oas/v3.0.4.html#reference-object) (`$ref`) is a reference identifier that specifies the location, as a URI, of the value being referenced. It references the `schemas` field of the [Components Object](https://spec.openapis.org/oas/v3.0.4.html#components-object), which holds reusable schema objects.
324
324
325
325
If you look at the `components` schema, you'll see the `properties` objects are empty.
Copy file name to clipboardExpand all lines: openapi/frameworks/rails.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ description: "Learn how to generate OpenAPI specifications for your Rails App us
7
7
8
8
When building APIs in a Ruby on Rails application, "Convention over Configuration" is already embraced. Building RESTful routes is standard for most Rails developers, as is writing tests using Test Driven Development (TDD), but creating an OpenAPI document that accurately describes an API can be another matter.
9
9
10
-
[The OpenAPI Specification](https://swagger.io/specification/) (formerly Swagger) has become the industry standard for documenting RESTful APIs, but manually writing and maintaining OpenAPI documents can be a time-consuming and error-prone process.
10
+
[The OpenAPI Specification](https://spec.openapis.org/oas/) has become the industry standard for documenting RESTful APIs, but manually writing and maintaining OpenAPI documents can be a time-consuming and error-prone process.
11
11
12
12
[Rswag](https://github.com/rswag/rswag) solves this problem by enabling OpenAPI documents to be generated directly from RSpec tests. This approach helps documentation stay in sync with the actual API implementation.
0 commit comments