From 46ffe838fdd9b8dbb7bc0f038b8d4b2d4ec8d1cb Mon Sep 17 00:00:00 2001 From: Thomas Guillier Date: Sat, 23 Mar 2024 18:40:50 +0100 Subject: [PATCH 1/2] Update README.md: replace endpoint.Schema with endpoint.SchemaResponseOption The type "endpoint.Schema" was renamed to "endpoint.SchemaResponseOption", this should be reflected in the README. --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 2a12ee3..3bcada6 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ func main() { endpoint.Summary("Add a new pet to the store"), endpoint.Description("Additional information on adding a pet to the store"), endpoint.Body(Pet{}, "Pet object that needs to be added to the store", true), - endpoint.Response(http.StatusOK, "Successfully added pet", endpoint.Schema(Pet{})), + endpoint.Response(http.StatusOK, "Successfully added pet", endpoint.SchemaResponseOption(Pet{})), endpoint.Security("petstore_auth", "read:pets", "write:pets"), ), endpoint.New( @@ -105,7 +105,7 @@ func main() { endpoint.Handler(handle), endpoint.Summary("Find pet by ID"), endpoint.Path("petId", "integer", "ID of pet to return", true), - endpoint.Response(http.StatusOK, "successful operation", endpoint.Schema(Pet{})), + endpoint.Response(http.StatusOK, "successful operation", endpoint.SchemaResponseOption(Pet{})), endpoint.Security("petstore_auth", "read:pets"), ), endpoint.New( @@ -113,7 +113,7 @@ func main() { endpoint.Handler(handle), endpoint.Path("petId", "integer", "ID of pet to return", true), endpoint.Security("petstore_auth", "read:pets"), - endpoint.ResponseSuccess(endpoint.Schema(struct { + endpoint.ResponseSuccess(endpoint.SchemaResponseOption(struct { ID string `json:"id"` Name string `json:"name"` }{})), @@ -316,19 +316,19 @@ func main() { endpoint.Handler(handle), endpoint.Description("Additional information on adding a pet to the store"), endpoint.Body(Pet{}, "Pet object that needs to be added to the store", true), - endpoint.Response(http.StatusOK, "Successfully added pet", endpoint.Schema(Pet{})), + endpoint.Response(http.StatusOK, "Successfully added pet", endpoint.SchemaResponseOption(Pet{})), endpoint.Security("petstore_auth", "read:pets", "write:pets"), ) get := endpoint.New("get", "/pet/{petId}", endpoint.Summary("Find pet by ID"), endpoint.Handler(handle), endpoint.Path("petId", "integer", "ID of pet to return", true), - endpoint.Response(http.StatusOK, "successful operation", endpoint.Schema(Pet{})), + endpoint.Response(http.StatusOK, "successful operation", endpoint.SchemaResponseOption(Pet{})), endpoint.Security("petstore_auth", "read:pets"), ) test := endpoint.New("put", "/pet/{petId}", endpoint.Handler(handle), endpoint.Path("petId", "integer", "ID of pet to return", true), - endpoint.Response(http.StatusOK, "successful operation", endpoint.Schema(struct { + endpoint.Response(http.StatusOK, "successful operation", endpoint.SchemaResponseOption(struct { ID string `json:"id"` Name string `json:"name"` }{})), From 6f53c34d2caabaa2f65645df06560980bd801375 Mon Sep 17 00:00:00 2001 From: Thomas Guillier Date: Sun, 24 Mar 2024 17:20:21 +0100 Subject: [PATCH 2/2] Update README_zh.md Replace endpoint.Schema with endpoint.SchemaResponseOption --- README_zh.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README_zh.md b/README_zh.md index 7dd5c8c..3cdf28c 100644 --- a/README_zh.md +++ b/README_zh.md @@ -95,7 +95,7 @@ func main() { endpoint.Summary("Add a new pet to the store"), endpoint.Description("Additional information on adding a pet to the store"), endpoint.Body(Pet{}, "Pet object that needs to be added to the store", true), - endpoint.Response(http.StatusOK, "Successfully added pet", endpoint.Schema(Pet{})), + endpoint.Response(http.StatusOK, "Successfully added pet", endpoint.SchemaResponseOption(Pet{})), endpoint.Security("petstore_auth", "read:pets", "write:pets"), ), endpoint.New( @@ -103,7 +103,7 @@ func main() { endpoint.Handler(handle), endpoint.Summary("Find pet by ID"), endpoint.Path("petId", "integer", "ID of pet to return", true), - endpoint.Response(http.StatusOK, "successful operation", endpoint.Schema(Pet{})), + endpoint.Response(http.StatusOK, "successful operation", endpoint.SchemaResponseOption(Pet{})), endpoint.Security("petstore_auth", "read:pets"), ), endpoint.New( @@ -111,7 +111,7 @@ func main() { endpoint.Handler(handle), endpoint.Path("petId", "integer", "ID of pet to return", true), endpoint.Security("petstore_auth", "read:pets"), - endpoint.ResponseSuccess(endpoint.Schema(struct { + endpoint.ResponseSuccess(endpoint.SchemaResponseOption(struct { ID string `json:"id"` Name string `json:"name"` }{})), @@ -314,19 +314,19 @@ func main() { endpoint.Handler(handle), endpoint.Description("Additional information on adding a pet to the store"), endpoint.Body(Pet{}, "Pet object that needs to be added to the store", true), - endpoint.Response(http.StatusOK, "Successfully added pet", endpoint.Schema(Pet{})), + endpoint.Response(http.StatusOK, "Successfully added pet", endpoint.SchemaResponseOption(Pet{})), endpoint.Security("petstore_auth", "read:pets", "write:pets"), ) get := endpoint.New("get", "/pet/{petId}", endpoint.Summary("Find pet by ID"), endpoint.Handler(handle), endpoint.Path("petId", "integer", "ID of pet to return", true), - endpoint.Response(http.StatusOK, "successful operation", endpoint.Schema(Pet{})), + endpoint.Response(http.StatusOK, "successful operation", endpoint.SchemaResponseOption(Pet{})), endpoint.Security("petstore_auth", "read:pets"), ) test := endpoint.New("put", "/pet/{petId}", endpoint.Handler(handle), endpoint.Path("petId", "integer", "ID of pet to return", true), - endpoint.Response(http.StatusOK, "successful operation", endpoint.Schema(struct { + endpoint.Response(http.StatusOK, "successful operation", endpoint.SchemaResponseOption(struct { ID string `json:"id"` Name string `json:"name"` }{})),