Skip to content

Modifying Model Schema/Class #5

@MisieX

Description

@MisieX

Hi,
I have a few questions regarding model schema generated by swagger:

  1. How do I modify foreign key property in json model schema? I know I can use
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "id")
@JsonIdentityReference(alwaysAsId = true)
@JsonProperty("foreignId")

and it works when I press the "Try It Out!". But is does NOT affect the model schema generated. In example: what would I need to do, to see only the category Id and not the whole Category when getting Persons in this project?

  1. In this project, model schema for GET /api/v1/cars is
{
  "model": "string",
  "year": "string",
  "make": "string"
}

but for the GET /api/v1/categories it is


even tough both Controllers return arrays of plain pojos. Why is that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions