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

Provide a method for Model Properties to by sorted by configurable methods #1023

Closed
nickpanaiotov opened this issue Oct 25, 2015 · 3 comments
Labels
Milestone

Comments

@nickpanaiotov
Copy link

Hi, there I trying to rearrange properties of some model in new spring boot application with only installed spring-fox 2.2.2 and spring-fox-ui 2.2.2.
Can you provide some demo in which this functionality works.
Thank you.

pom.xml

org.springframework.boot
spring-boot-starter-parent
1.2.7.RELEASE



org.springframework.boot
spring-boot-starter-web


io.springfox
springfox-swagger2
2.2.2


io.springfox
springfox-swagger-ui
2.2.2

@dilipkrish
Copy link
Member

This is a true statement. It currently sorts it alphabetically.

@dilipkrish dilipkrish added this to the 2.4.0 milestone Oct 27, 2015
@dilipkrish dilipkrish changed the title @ApiModelProperties position still doesn't work. Provide a method for Model Properties to by sorted by configurable methods Oct 27, 2015
@nickpanaiotov
Copy link
Author

I created function in ApiModelPropertyPropertyBuilder which allows the @ApiAnotationProperty to get value for position. Also sorted model properties by this value in DefaultModelProvider.modelFor(), but still something in chain after that reorder them.

edit: I fixed it, but it is not tested.
https://github.com/nickpanaiotov/springfox

@dilipkrish
Copy link
Member

@nickpanaiotov Currently properties are sortable using position and then by name. I would think this to be sufficient for this use case. Closing this issue as fixed. Please feel free to re-open if you think you still have a case where this isn't satisfying your need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants