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

Add ownerId property to Pet #74

Merged
merged 1 commit into from
Dec 29, 2021
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.springframework.samples.petclinic.mapper;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.springframework.samples.petclinic.rest.dto.PetDto;
import org.springframework.samples.petclinic.rest.dto.PetFieldsDto;
import org.springframework.samples.petclinic.rest.dto.PetTypeDto;
Expand All @@ -14,6 +15,8 @@
*/
@Mapper
public interface PetMapper {

@Mapping(source = "owner.id", target = "ownerId")
PetDto toPetDto(Pet pet);

Collection<PetDto> toPetsDto(Collection<Pet> pets);
Expand Down
8 changes: 8 additions & 0 deletions src/main/resources/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,14 @@ components:
minimum: 0
example: 1
readOnly: true
ownerId:
title: Owner ID
description: The ID of the pet's owner.
type: integer
format: int32
minimum: 0
example: 1
readOnly: true
visits:
title: Visits
description: Vet visit bookings for this pet.
Expand Down