Skip to content

Commit

Permalink
feat(openapi): using resource singular
Browse files Browse the repository at this point in the history
this makes it easier to extract the resource singular
for arguments.
  • Loading branch information
toumorokoshi committed Oct 30, 2024
1 parent c02b926 commit 96da039
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 66 deletions.
60 changes: 30 additions & 30 deletions example/bookstore/v1/bookstore_openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
]
}
},
"/publishers/{publisher_id}": {
"/publishers/{publisher}": {
"delete": {
"responses": {
"200": {
Expand All @@ -77,7 +77,7 @@
"parameters": [
{
"in": "path",
"name": "publisher_id",
"name": "publisher",
"schema": {},
"required": true,
"type": "string"
Expand All @@ -95,7 +95,7 @@
"parameters": [
{
"in": "path",
"name": "publisher_id",
"name": "publisher",
"schema": {},
"required": true,
"type": "string"
Expand All @@ -113,7 +113,7 @@
"parameters": [
{
"in": "path",
"name": "publisher_id",
"name": "publisher",
"schema": {},
"required": true,
"type": "string"
Expand Down Expand Up @@ -146,7 +146,7 @@
]
}
},
"/publishers/{publisher_id}/books": {
"/publishers/{publisher}/books": {
"get": {
"responses": {
"200": {
Expand All @@ -160,7 +160,7 @@
"parameters": [
{
"in": "path",
"name": "publisher_id",
"name": "publisher",
"schema": {},
"required": true,
"type": "string"
Expand Down Expand Up @@ -192,7 +192,7 @@
"parameters": [
{
"in": "path",
"name": "publisher_id",
"name": "publisher",
"schema": {},
"required": true,
"type": "string"
Expand All @@ -214,7 +214,7 @@
]
}
},
"/publishers/{publisher_id}/books/{book_id}": {
"/publishers/{publisher}/books/{book}": {
"delete": {
"responses": {
"200": {
Expand All @@ -224,14 +224,14 @@
"parameters": [
{
"in": "path",
"name": "publisher_id",
"name": "publisher",
"schema": {},
"required": true,
"type": "string"
},
{
"in": "path",
"name": "book_id",
"name": "book",
"schema": {},
"required": true,
"type": "string"
Expand All @@ -249,14 +249,14 @@
"parameters": [
{
"in": "path",
"name": "publisher_id",
"name": "publisher",
"schema": {},
"required": true,
"type": "string"
},
{
"in": "path",
"name": "book_id",
"name": "book",
"schema": {},
"required": true,
"type": "string"
Expand All @@ -274,14 +274,14 @@
"parameters": [
{
"in": "path",
"name": "publisher_id",
"name": "publisher",
"schema": {},
"required": true,
"type": "string"
},
{
"in": "path",
"name": "book_id",
"name": "book",
"schema": {},
"required": true,
"type": "string"
Expand All @@ -306,7 +306,7 @@
"parameters": [
{
"in": "path",
"name": "publisher_id",
"name": "publisher",
"schema": {},
"required": true,
"type": "string"
Expand All @@ -321,7 +321,7 @@
]
}
},
"/publishers/{publisher_id}/books/{book_id}/editions": {
"/publishers/{publisher}/books/{book}/editions": {
"get": {
"responses": {
"200": {
Expand All @@ -335,14 +335,14 @@
"parameters": [
{
"in": "path",
"name": "publisher_id",
"name": "publisher",
"schema": {},
"required": true,
"type": "string"
},
{
"in": "path",
"name": "book_id",
"name": "book",
"schema": {},
"required": true,
"type": "string"
Expand Down Expand Up @@ -374,14 +374,14 @@
"parameters": [
{
"in": "path",
"name": "publisher_id",
"name": "publisher",
"schema": {},
"required": true,
"type": "string"
},
{
"in": "path",
"name": "book_id",
"name": "book",
"schema": {},
"required": true,
"type": "string"
Expand All @@ -403,7 +403,7 @@
]
}
},
"/publishers/{publisher_id}/books/{book_id}/editions/{book_edition_id}": {
"/publishers/{publisher}/books/{book}/editions/{book-edition}": {
"delete": {
"responses": {
"200": {
Expand All @@ -413,21 +413,21 @@
"parameters": [
{
"in": "path",
"name": "publisher_id",
"name": "publisher",
"schema": {},
"required": true,
"type": "string"
},
{
"in": "path",
"name": "book_id",
"name": "book",
"schema": {},
"required": true,
"type": "string"
},
{
"in": "path",
"name": "book_edition_id",
"name": "book-edition",
"schema": {},
"required": true,
"type": "string"
Expand All @@ -445,21 +445,21 @@
"parameters": [
{
"in": "path",
"name": "publisher_id",
"name": "publisher",
"schema": {},
"required": true,
"type": "string"
},
{
"in": "path",
"name": "book_id",
"name": "book",
"schema": {},
"required": true,
"type": "string"
},
{
"in": "path",
"name": "book_edition_id",
"name": "book-edition",
"schema": {},
"required": true,
"type": "string"
Expand Down Expand Up @@ -515,7 +515,7 @@
"singular": "book",
"plural": "books",
"patterns": [
"/publishers/{publisher_id}/books/{book_id}"
"/publishers/{publisher}/books/{book}"
],
"parents": [
"publisher"
Expand Down Expand Up @@ -545,7 +545,7 @@
"singular": "book-edition",
"plural": "book-editions",
"patterns": [
"/publishers/{publisher_id}/books/{book_id}/editions/{book_edition_id}"
"/publishers/{publisher}/books/{book}/editions/{book-edition}"
],
"parents": [
"book"
Expand All @@ -572,7 +572,7 @@
"singular": "publisher",
"plural": "publishers",
"patterns": [
"/publishers/{publisher_id}"
"/publishers/{publisher}"
]
}
}
Expand Down
Loading

0 comments on commit 96da039

Please sign in to comment.