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

Enumeration of data model properties #21

Closed
gbisaga opened this issue Apr 6, 2014 · 2 comments
Closed

Enumeration of data model properties #21

gbisaga opened this issue Apr 6, 2014 · 2 comments

Comments

@gbisaga
Copy link

gbisaga commented Apr 6, 2014

I have a case where I have an enumeration that can return different String values. The @ApiModelProperty's allowableValues is close, but I need to have metadata associated with each possible value. Something like this:

@ApiModelProperty(...., allowableValues={
@ApiModelPropertyValue( value="registered", description="Yada yada...", discriminator="PUT" ),
@ApiModelPropertyValue( value="active", description="Yada yada...", discriminator="PUT,POST" ),
@ApiModelPropertyValue( value="closed", description="Yada yada...", discriminator="POST" )
});

It seems like any time there is a value, you'd need to at least describe the possible values.

fehguy added a commit that referenced this issue Sep 8, 2014
added model sample with sample values
@webron
Copy link
Member

webron commented Sep 19, 2014

Swagger 2.0 allows for more extensive external documentation but it does not offer the ability to attach a description to fixed values in the allowableValues list.

I will close the issue for now, but will mark it as a feature proposal for the next spec version.

@webron
Copy link
Member

webron commented Mar 27, 2016

Closing in favor of #348.

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

No branches or pull requests

2 participants