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

Create ProfileResponseDto #1

Closed
Xazin opened this issue May 25, 2022 · 0 comments
Closed

Create ProfileResponseDto #1

Xazin opened this issue May 25, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@Xazin
Copy link
Member

Xazin commented May 25, 2022

Description
Currently, we use the ProfileDto in the @ApiResponse decorator inside the ProfileController, this is not relevant. This DTO is used for incoming requests only, we should instead implement a ProfileResponseDto instead.

For Swagger to show this response, the fields must be decorated with proper @ApiProperty decorators.

Acceptance Criteria

  • In the @ApiResponse decorator for getProfile and getAuthedProfile use ProfileResponseDto so that it correctly displays the response in Swagger UI
  • Example Value for the Response in Swagger must show the correctly returned object.

Sample Response

{
  "id": "628cdea92e19fd912f0d520e",
  "userId": "O9pbPDY3s5e5XwzgwKZtZTDPvLS2",
  "phone": "+4530249838",
  "location": {
    "code": "NL",
    "name": "Netherlands"
  },
  "firstName": "Mathias",
  "lastName": "M",
  "bio": "I am a cool guy aye"
}

Current Response Example Value

{
  "phone": "+31612345678",
  "country": "string",
  "firstName": "John",
  "lastName": "Doe",
  "bio": "I am a cool guy"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants