grape-swagger icon indicating copy to clipboard operation
grape-swagger copied to clipboard

How to have custom/complex Datatype for api parameter

Open rkgarg opened this issue 13 years ago • 6 comments

How to have my custom datatype Model & Model Schema visible in Swagger UI similar to: http://petstore.swagger.wordnik.com/#!/user/createUser_post_1 ?

With https://github.com/wordnik/swagger-core/wiki/Datatypes , seems like model API has to be defined somewhere.

Is there any code example with this implementation?

rkgarg avatar Apr 23 '13 13:04 rkgarg

+1

HudsonAfonso avatar Apr 27 '13 03:04 HudsonAfonso

+1

alexandru-calinoiu avatar May 21 '13 11:05 alexandru-calinoiu

does anyone know how to have this defined in grape first?

alexandru-calinoiu avatar May 21 '13 11:05 alexandru-calinoiu

There's no way to define complex input types in grape, and that is the problem. Even if we try to extract the type schemas from params blocks here, we'll have no way to name the types, or do anything sane about the possible duplication.

dgutov avatar Jul 08 '13 04:07 dgutov

why it is still open? any fix for this? I think that is very useful use model scheme and has body param support!

so +1

chebyte avatar Apr 09 '14 14:04 chebyte

There's some discussion around this in #49.

dblock avatar Jul 14 '14 15:07 dblock