Skip to content

Instantly share code, notes, and snippets.

@prat0318
Created August 2, 2014 00:51
Show Gist options
  • Save prat0318/14ca018bb7f89e81bc2a to your computer and use it in GitHub Desktop.
Save prat0318/14ca018bb7f89e81bc2a to your computer and use it in GitHub Desktop.
[15:21] == prat0318 [4812e9bc@gateway/web/freenode/ip.72.18.233.188] has joined #swagger
[15:24] <prat0318> In the petstore's pet resource, path "/pet/uploadImage" ...i want to fix the paramType for 'file' from 'body' to 'form' as per the specs 1.2 ... are the api-docs public, to which i can send a PR?
[15:25] <prat0318> I ask this becuase i have added that validation in my client ..and the petstore example fails that validation prohibiting me from using it as an example. What can i do to fix it?
[15:30] <prat0318> I am referring to : https://github.com/wordnik/swagger-spec/issues/16 .. Can we fix the example?
[16:04] <@tonytam> hi prat0318
[16:04] <prat0318> tonytam: hi
[16:04] <@tonytam> that sample comes from here: https://github.com/wordnik/swagger-core/tree/master/samples/scala-oauth-authorization-server
[16:05] <@tonytam> so the defect is not in the json, it's in the json-generation, which is buried in the server integration
[16:05] == mysterlu_ [[email protected]] has quit [Remote host closed the connection]
[16:06] <prat0318> tonytam: aah ok ... any workarounds ..or any nearby fixes to the json generation
[16:06] <@tonytam> let me see
[16:06] == mysterlu_ [[email protected]] has joined #swagger
[16:08] <@tonytam> honestly i didn't see that issue
[16:09] <prat0318> tonytam: ok ...may be i would have to relax my validations to adopt to the example then
[16:09] <@tonytam> are you writing a schema validator?
[16:10] == mysterlu_ [[email protected]] has quit [Ping timeout: 244 seconds]
[16:10] <prat0318> I am working on generic client lib for python - a replacement for codegen - https://github.com/Yelp/swagger-py
[16:11] <@tonytam> ah nice!
[16:11] <prat0318> so for body - i add a header of app/json and for file - i add multipart ... but with both present ... ambiguity can occur
[16:11] <@tonytam> did you know of the one written by the asterisk folks?
[16:12] <prat0318> yeah ...it is a fork of that ... somehow the link got removed ..
[16:12] <@tonytam> not to disrupt your coding, but let me at least share what they did
[16:12] <prat0318> we have enhanced it with asynch client and much more
[16:13] <@tonytam> here you go
[16:13] <@tonytam> https://github.com/digium/swagger-py
[16:13] <@tonytam> ok let me look at that bug now
[16:14] <@tonytam> phone call gimme a few
[16:14] <prat0318> tonytam: np
[16:14] <prat0318> it will be great if example gets fixed so that in my README docs i can quote petstore usages
[16:14] <prat0318> and sample calls
[16:19] <@tonytam> ok i found the bug
[16:20] <prat0318> tonytam: woot ... awesome!
[16:20] <@tonytam> hmm
[16:21] <@tonytam> https://github.com/wordnik/swagger-core/blob/master/modules/swagger-jersey-jaxrs/src/main/scala/com/wordnik/swagger/jersey/JerseyApiReader.scala#L179-L180
[16:21] <@tonytam> it has been like this for a long time
[16:21] <@tonytam> i'll have to see what breaks...
[16:22] <prat0318> aah cool ...
[16:26] <@tonytam> yea that broke the UI. good timing, I have to make a change to it
[16:28] <prat0318> so may be ...UI and core changes would have to go together
[16:28] <@tonytam> yes that's right
[16:28] <@tonytam> it's probably a one-liner, i'm looking still
[16:32] <@tonytam> hey you're at yelp, correct?
[16:32] <prat0318> Yeah
[16:33] <@tonytam> you work with colin pollock?
[16:33] <@tonytam> i know yelp is big
[16:33] <@tonytam> but he worked here, and a bit on swagger as well
[16:33] <prat0318> no ... i have worked with striglia regarding swagger
[16:34] <@tonytam> is he there too? i didn't know
[16:34] <striglia> heh I didn't know you knew colin tony
[16:34] <@tonytam> yea, he used to work at reverb (was wordnik then)
[16:34] <striglia> nice. Yeah he's roughly on my team (sort of a sister team)
[16:34] <@tonytam> that's great. what team are you on?
[16:35] <striglia> We're both under the search team umbrella. He's on the quality side (ranking, new features, etc.) and I'm on the data quality/data mining side
[16:35] <@tonytam> oh really
[16:39] <@tonytam> ok i think i can make swagger-ui work with both the old (broken) and new (fixed) json
[16:39] <prat0318> wow ..that will be cool .. that means the example can be updated very soon
[16:40] <@tonytam> yes, it does. say, are you running unit tests against our sample site?
[16:41] <prat0318> i have a README https://github.com/Yelp/swagger-py#api which gives your example
[16:42] <@tonytam> is this a fork of the digium one?
[16:42] <@tonytam> or do you guys all put commits like "Big refactoring."
[16:42] <prat0318> yeah ... it is a fork ... somehow the link got removed ...
[16:43] <prat0318> i think that commit was from diguim
[16:48] <@tonytam> still looking… there's a error in the upload now
[16:54] <prat0318> ok .. np
[16:57] <@tonytam> prat0318 you know about the 2.0 spec of swagger, right?
[16:57] <prat0318> Yeah, i am on the work group
[16:57] <@tonytam> ok just making sure
[16:57] <prat0318> it looks very promising!
[16:57] <@tonytam> i don't know all the user handles :)
[16:58] <prat0318> yeah i am not that active (mainly read only)
[17:09] == daedeloth [[email protected]] has quit [Remote host closed the connection]
[17:09] <@tonytam> ok fixed
[17:09] <@tonytam> will push an update
[17:11] <prat0318> tonytam++
[17:11] <prat0318> really appreciate the quick fix :)
[17:13] <@tonytam> a side effect of this fix is that multiplle file uploads should work now
[17:15] == adhock [[email protected]] has quit [Quit: …]
[17:18] <prat0318> cool!
[17:18] <@tonytam> ok i'm deploying the updated sample
[17:19] <@tonytam> gimme a few for that, also swagger-ui is updated
[17:22] <@tonytam> ok prat0318 all done
[17:23] <@tonytam> the sample app gives an error on upload, but that's not a problem
[17:23] <prat0318> wow ... <3 thanks a lot...
[17:23] <prat0318> i guess #16 can be marked resolved
[17:24] <@tonytam> yes
[17:27] == tsppp [[email protected]] has left #swagger []
[17:34] <@tonytam> euoia i think the build stuff is fixed
[17:35] <@tonytam> can you pull from master?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment