Skip to content

Commit

Permalink
Update REAMDE.md
Browse files Browse the repository at this point in the history
Update REAMDE example with OpenAPI 3.1 version
  • Loading branch information
juhaku committed Aug 11, 2024
1 parent c774742 commit 918bdb2
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ This would produce an API doc something similar to:

```json
{
"openapi": "3.0.3",
"openapi": "3.1.0",
"info": {
"title": "application name from Cargo.toml",
"description": "description from Cargo.toml",
Expand All @@ -212,21 +212,22 @@ This would produce an API doc something similar to:
"paths": {
"/pets/{id}": {
"get": {
"tags": ["pet_api"],
"tags": [
"pet_api"
],
"summary": "Get pet by id",
"description": "Get pet from database by pet id\n",
"description": "Get pet from database by pet id",
"operationId": "get_pet_by_id",
"parameters": [
{
"name": "id",
"in": "path",
"description": "Pet database id to get Pet for",
"required": true,
"deprecated": false,
"schema": {
"type": "integer",
"format": "int64",
"minimum": 0,
"minimum": 0
}
}
],
Expand All @@ -244,29 +245,33 @@ This would produce an API doc something similar to:
"404": {
"description": "Pet was not found"
}
},
"deprecated": false
}
}
}
},
"components": {
"schemas": {
"Pet": {
"type": "object",
"required": ["id", "name"],
"required": [
"id",
"name"
],
"properties": {
"age": {
"type": [
"integer",
"null"
],
"format": "int32"
},
"id": {
"type": "integer",
"format": "int64",
"minimum": 0,
"minimum": 0
},
"name": {
"type": "string"
},
"age": {
"type": "integer",
"format": "int32",
"nullable": true,
}
}
}
Expand Down

0 comments on commit 918bdb2

Please sign in to comment.