Skip to content
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

Update README.md: replace endpoint.Schema with endpoint.SchemaRespons… #42

Merged
merged 2 commits into from
Mar 25, 2024
Merged
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
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,23 +97,23 @@ 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(
http.MethodGet, "/pet/{petId}",
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(
http.MethodPut, "/pet/{petId}",
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"`
}{})),
Expand Down Expand Up @@ -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"`
}{})),
Expand Down
12 changes: 6 additions & 6 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,23 +95,23 @@ 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(
http.MethodGet, "/pet/{petId}",
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(
http.MethodPut, "/pet/{petId}",
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"`
}{})),
Expand Down Expand Up @@ -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"`
}{})),
Expand Down
Loading