Showing results for 
Search instead for 
Did you mean: 

swagger-ui JPA relationships

New Contributor

swagger-ui JPA relationships



I'm using swagger-ui with Spring Boot.

In my models are some relationships like





Can I tell swagger-ui that it shouldn't put in the complete related model, but only the table field with the key_id?


I know that is something DB specific how the relationships are handled, but I know that with ...


class Mother {
    @OneToMany(mappedBy = "mother")
    List<Child> childs;

class Child {
    Mother mother;

there is a field mother_id in table CHILD.

I don't want to see the Mother object but only this mother_id in swagger-ui.


Can this be configured?



Tags (2)

Re: swagger-ui JPA relationships

Swagger UI is a project that renders API definitions that are being produced by Springfox (in your case). Springfox translates your code into the API definition and uses your code to extract what your API looks like.


Springfox is not one of our projects and we're not familiar with it enough to offer support for it. We recommend filing a ticket directly with the project in Github.

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓
New Contributor

Re: swagger-ui JPA relationships

Ok. I've thought of something like @ApiModelProperty. So I've asked.

I'll try now to find something in Springfox.

Thx @RonRatovsky 

New Here?
Join us and watch the welcome video: