swagger-ui JPA relationships
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Labels:
-
Swagger UI
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.↓↓↓↓↓
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok. I've thought of something like @ApiModelProperty. So I've asked.
I'll try now to find something in Springfox.
Thx @RonRatovsky
