cancel
Showing results for 
Search instead for 
Did you mean: 

swagger-ui JPA relationships

New Contributor

swagger-ui JPA relationships

Hi,

 

I'm using swagger-ui with Spring Boot.

In my models are some relationships like

@OneToMany

and

@ManyToOne

 

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 {
    @ManyToOne
    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?

 

Thx

Tags (2)
2 REPLIES 2
Moderator

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.

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:
Top Kudoed Authors