Skip to content
This repository has been archived by the owner on Feb 19, 2020. It is now read-only.

Where can I declare modelTypes? #46

Open
caente opened this issue Nov 25, 2014 · 2 comments
Open

Where can I declare modelTypes? #46

caente opened this issue Nov 25, 2014 · 2 comments

Comments

@caente
Copy link

caente commented Nov 25, 2014

The README says:

If the dataType value is not of the basic types, spray-swagger will try and find the type in the modelTypes sequence. Refer to swagger-core for other attribute information.

But I haven't found where to set those modelTypes, I presume would look like this:

modelTypes = Seq(typeOf[Meeting])
@joshuaconner
Copy link

I think(?) this is just documentation that needs to be updated. In our experience, swagger-core will attempt to load and introspect on the models for you., so if you do:

@ApiImplicitParams(Array(
  new ApiImplicitParam(name="deviceInfo", required=true, dataType="com.example.models.DeviceInfo", paramType="body", value="Info about the device sending the event.")
))

the DeviceInfo model, complete with schema, will show up in your swagger documentation. (Note that we had to use the fully-qualified path for the dataType param to get it to show up consistently.)

@caente
Copy link
Author

caente commented Dec 20, 2014

Right! it works, yeah the “trick” was the fully qualified name, and apparently it won’t work with case class inside other objects, but I knew that

thanks!

 

                                 

                                    Miguel A. Iglesias

about.me/caente

On Fri, Dec 19, 2014 at 4:51 PM, Joshua Conner [email protected]
wrote:

I think(?) this is just documentation that needs to be updated. In our experience, swagger-core will attempt to load and introspect on the models for you., so if you do:

@ApiImplicitParams(Array(
  new ApiImplicitParam(name="deviceInfo", required=true, dataType="com.example.models.DeviceInfo", paramType="body", value="Info about the device sending the event.")
))

the DeviceInfo model, complete with schema, will show up in your swagger documentation. (Note that we had to use the fully-qualified path for the dataType param to get it to show up consistently.)

Reply to this email directly or view it on GitHub:
#46 (comment)

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

No branches or pull requests

2 participants