Skip to content

feat: generate schema from paths OpenAPI prop #230

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion example/output/json/components.schemas/Address.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
}
},
"title": "Address",
"$id": "Address.json"
"$id": "components.schemas/Address.json"
}
2 changes: 1 addition & 1 deletion example/output/json/components.schemas/ApiResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
}
},
"title": "ApiResponse",
"$id": "ApiResponse.json"
"$id": "components.schemas/ApiResponse.json"
}
2 changes: 1 addition & 1 deletion example/output/json/components.schemas/Category.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
}
},
"title": "Category",
"$id": "Category.json"
"$id": "components.schemas/Category.json"
}
2 changes: 1 addition & 1 deletion example/output/json/components.schemas/Customer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
}
},
"title": "Customer",
"$id": "Customer.json"
"$id": "components.schemas/Customer.json"
}
2 changes: 1 addition & 1 deletion example/output/json/components.schemas/Order.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@
}
},
"title": "Order",
"$id": "Order.json"
"$id": "components.schemas/Order.json"
}
2 changes: 1 addition & 1 deletion example/output/json/components.schemas/Pet.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@
}
},
"title": "Pet",
"$id": "Pet.json"
"$id": "components.schemas/Pet.json"
}
2 changes: 1 addition & 1 deletion example/output/json/components.schemas/Tag.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
}
},
"title": "Tag",
"$id": "Tag.json"
"$id": "components.schemas/Tag.json"
}
2 changes: 1 addition & 1 deletion example/output/json/components.schemas/User.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@
}
},
"title": "User",
"$id": "User.json"
"$id": "components.schemas/User.json"
}
129 changes: 129 additions & 0 deletions example/output/json/paths/Pet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
{
"type": "object",
"properties": {
"put": {
"type": "object",
"required": [
"requestBody",
"responses"
],
"description": "Update an existing pet by Id",
"summary": "Update an existing pet",
"properties": {
"requestBody": {
"type": "object",
"properties": {
"content": {
"type": "object",
"required": [],
"properties": {
"application/json": {
"$ref": "../components.schemas/Pet.json",
"description": "Update an existent pet in the store"
},
"application/xml": {
"$ref": "../components.schemas/Pet.json",
"description": "Update an existent pet in the store"
},
"application/x-www-form-urlencoded": {
"$ref": "../components.schemas/Pet.json",
"description": "Update an existent pet in the store"
}
}
}
},
"description": "Update an existent pet in the store"
},
"responses": {
"type": "object",
"properties": {
"200": {
"type": "object",
"properties": {
"application/json": {
"$ref": "../components.schemas/Pet.json",
"description": "Successful operation"
},
"application/xml": {
"$ref": "../components.schemas/Pet.json",
"description": "Successful operation"
}
}
},
"400": {
"description": "Invalid ID supplied"
},
"404": {
"description": "Pet not found"
},
"405": {
"description": "Validation exception"
}
}
}
}
},
"post": {
"type": "object",
"required": [
"requestBody",
"responses"
],
"description": "Add a new pet to the store",
"summary": "Add a new pet to the store",
"properties": {
"requestBody": {
"type": "object",
"properties": {
"content": {
"type": "object",
"required": [],
"properties": {
"application/json": {
"$ref": "../components.schemas/Pet.json",
"description": "Create a new pet in the store"
},
"application/xml": {
"$ref": "../components.schemas/Pet.json",
"description": "Create a new pet in the store"
},
"application/x-www-form-urlencoded": {
"$ref": "../components.schemas/Pet.json",
"description": "Create a new pet in the store"
}
}
}
},
"description": "Create a new pet in the store"
},
"responses": {
"type": "object",
"properties": {
"200": {
"type": "object",
"properties": {
"application/json": {
"$ref": "../components.schemas/Pet.json",
"description": "Successful operation"
},
"application/xml": {
"$ref": "../components.schemas/Pet.json",
"description": "Successful operation"
}
}
},
"405": {
"description": "Invalid input"
}
}
}
}
}
},
"required": [
"put",
"post"
],
"title": "Pet",
"$id": "paths/Pet.json"
}
63 changes: 63 additions & 0 deletions example/output/json/paths/PetFindByStatus.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"type": "object",
"properties": {
"get": {
"type": "object",
"required": [
"parameters",
"responses"
],
"description": "Multiple status values can be provided with comma separated strings",
"summary": "Finds Pets by status",
"properties": {
"parameters": {
"type": "object",
"properties": {
"status": {
"type": "string",
"default": "available",
"enum": [
"available",
"pending",
"sold"
],
"description": "Status values that need to be considered for filter"
}
}
},
"responses": {
"type": "object",
"properties": {
"200": {
"type": "object",
"properties": {
"application/json": {
"type": "array",
"items": {
"$ref": "../components.schemas/Pet.json"
},
"description": "successful operation"
},
"application/xml": {
"type": "array",
"items": {
"$ref": "../components.schemas/Pet.json"
},
"description": "successful operation"
}
}
},
"400": {
"description": "Invalid status value"
}
}
}
}
}
},
"required": [
"get"
],
"title": "PetFindByStatus",
"$id": "paths/PetFindByStatus.json"
}
60 changes: 60 additions & 0 deletions example/output/json/paths/PetFindByTags.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"type": "object",
"properties": {
"get": {
"type": "object",
"required": [
"parameters",
"responses"
],
"description": "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
"summary": "Finds Pets by tags",
"properties": {
"parameters": {
"type": "object",
"properties": {
"tags": {
"type": "array",
"items": {
"type": "string"
},
"description": "Tags to filter by"
}
}
},
"responses": {
"type": "object",
"properties": {
"200": {
"type": "object",
"properties": {
"application/json": {
"type": "array",
"items": {
"$ref": "../components.schemas/Pet.json"
},
"description": "successful operation"
},
"application/xml": {
"type": "array",
"items": {
"$ref": "../components.schemas/Pet.json"
},
"description": "successful operation"
}
}
},
"400": {
"description": "Invalid tag value"
}
}
}
}
}
},
"required": [
"get"
],
"title": "PetFindByTags",
"$id": "paths/PetFindByTags.json"
}
Loading
Loading