Skip to content

Added optional configs for settings #43

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

joshkehn
Copy link
Contributor

This allows the following settings variables to be set:

  • TASTYPIE_SWAGGER_APP_NAME configures the display name on the documentation page. Defaults to swagger.
  • TASTYPIE_SWAGGER_APP_LINK configures the app link on the documentation page. Defaults to /.
  • TASTYPIE_SWAGGER_SHOW_DEV allows showing or hiding the development links. Defaults to False.
  • TASTYPIE_SWAGGER_KEY_NAME allows configuring the api key name. Defaults to apiKey.
  • TASTYPIE_SWAGGER_API_KEY allows configuring a prefilled api key. Defaults to an empty string.

The README file has been updated with explanations of these as well.

@rmutter
Copy link

rmutter commented Dec 11, 2013

Looks like there's one typo in the documentation and pull request description. The second TASTYPIE_SWAGGER_APP_NAME needs to be renamed to TASTYPIE_SWAGGER_APP_LINK.

@joshkehn
Copy link
Contributor Author

Updated, thanks @rmutter for the catch.

@Seraf
Copy link

Seraf commented Dec 11, 2013

Great PR ! Should be great to have an input box on the web part for the API Key to be more dynamic and filling it by reading a default cookie like tastypie_credentials.
As docs can be embedded in a webapp that plays with the tastypie apikey, swagger ui will be able to directly use the credentials of the authenticated user.
I don't know if it's understandable, but it should be a very nice integration :)

@fehguy
Copy link

fehguy commented Dec 11, 2013

You might look at the swagger 1.2 spec, which lets the name of api keys be set in the swagger json. The UI could easily read this and populate the key name.

The authorizations info:
https://github.com/wordnik/swagger-core/wiki/authorizations

An example of such:
http://petstore.swagger.wordnik.com/api/api-docs

And an alternate UI that has the api key name driven off the spec:
https://github.com/wordnik/swagger-ui/tree/authorization

@joshkehn
Copy link
Contributor Author

@fehguy Nice, I'll have to check that out. Currently I'm making modifications as I use it, but I'll definitely be looking forwards to making this play nice with upgraded versions of swagger.

@johnraz
Copy link
Contributor

johnraz commented Feb 10, 2014

I love the idea but I would rather implement this as a dictionary ;-)

@joshkehn
Copy link
Contributor Author

@johnraz Agreed 100%. I'm going to restructure this.

@joshkehn joshkehn self-assigned this Feb 11, 2014
@johnraz
Copy link
Contributor

johnraz commented Feb 16, 2014

@joshkehn : also make sure to make it "multi-api" ready. I guess using the app_name has the first main dictionary key should be ok ;-)

@johnraz
Copy link
Contributor

johnraz commented Mar 26, 2014

@joshkehn : any chance you'd get some time soon (in the coming days) to get this done ? otherwise I think I'll do it (need it for a paid project of mine).
Thanks !

@joshkehn
Copy link
Contributor Author

@johnraz I'll see what I can get done this weekend!

@johnraz
Copy link
Contributor

johnraz commented Mar 27, 2014

Super awesome thanks :)

@johnraz
Copy link
Contributor

johnraz commented Apr 4, 2014

@joshkehn : I know it's wrong but yet I friendly bump ;)

@joshkehn
Copy link
Contributor Author

joshkehn commented Apr 7, 2014

I'll work on this today, sorry life got in the way 🍧

@johnraz
Copy link
Contributor

johnraz commented Apr 7, 2014

Splendid!

@joshkehn
Copy link
Contributor Author

joshkehn commented Apr 8, 2014

@johnraz I updated it to be a dictionary and updated the documentation to match. The current app I have using this I can't drop-in this branch to replace because there are some errors in mapping.py.

Let me know how this update looks and I'll pull this together into a separate branch from master and work out any kinks.

@johnraz
Copy link
Contributor

johnraz commented Apr 8, 2014

I will try to give it a look tomorrow. Thanks !

@johnraz
Copy link
Contributor

johnraz commented Apr 8, 2014

Ok I finally had some time to look at it.
The API_MODULE settings is deprecated and shouldn't be defined anymore.
We are now using the doc directory for read the docs, so please move the documentation there.
I suggest you rebase current master on your branch.
Other than that, LGTM.

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

Successfully merging this pull request may close these issues.

5 participants