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

Support for dynamic resources #48

Open
vitamon opened this issue Dec 15, 2014 · 2 comments
Open

Support for dynamic resources #48

vitamon opened this issue Dec 15, 2014 · 2 comments

Comments

@vitamon
Copy link

vitamon commented Dec 15, 2014

I need to expose some user-defined resources which are dynamically created at runtime.
It would be great to have some hook to append them to the static resources list which returns the SwaggerHttpService. Unfortunately everything there either final or private and there's no simple way to override the api without changing the library sources. I can override "toJsonString" and pattern match the param, but it is a bit hackish :)

@mhamrah
Copy link
Contributor

mhamrah commented Dec 15, 2014

That's an interesting idea. How would you like the API to work? Does your code create the swagger model, or would you annotate it at runtime?

@vitamon
Copy link
Author

vitamon commented Dec 15, 2014

I'd like to append the listings like this:
for ((subPath, apiListing) <- api.listings ++ dynamicResourceListings()

and in the overriden def dynamicResourceListings, I'd query my db for dynamic resources and map them List[myResource] => ApiListing[ApiDescription]

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