Skip to content

Commit

Permalink
proto: fix CreateUser Openapi3 doc (#1038)
Browse files Browse the repository at this point in the history
it uses the entire user object in REST, without the request wrapper
type.
  • Loading branch information
birdayz committed Jan 26, 2024
1 parent 6c8f916 commit d2553b0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion backend/pkg/tools/openapi-generator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ func updateUsers(doc3 *openapi3.T) {
Password: "secure-password",
Mechanism: v1alpha1.SASLMechanism_SASL_MECHANISM_SCRAM_SHA_256,
}}
doc3.Paths.Value("/v1alpha1/users").Post.RequestBody.Value.Content["application/json"].Example = toExample(createUserReq, "Create User", "Create user", false).Value
doc3.Paths.Value("/v1alpha1/users").Post.RequestBody.Value.Content["application/json"].Example = toExample(createUserReq.User, "Create User", "Create user", false).Value

// Responses
response := &v1alpha1.CreateUserResponse{User: &v1alpha1.CreateUserResponse_User{
Expand Down
2 changes: 1 addition & 1 deletion proto/gen/openapi/openapi.json

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions proto/gen/openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2333,10 +2333,9 @@ paths:
content:
application/json:
example:
user:
mechanism: SASL_MECHANISM_SCRAM_SHA_256
name: payment-service
password: secure-password
mechanism: SASL_MECHANISM_SCRAM_SHA_256
name: payment-service
password: secure-password
schema:
$ref: '#/components/schemas/CreateUserRequest.User'
required: true
Expand Down

0 comments on commit d2553b0

Please sign in to comment.