These are chat archives for zalando/play-swagger

18th
Apr 2016
slavaschmidt
@slavaschmidt
Apr 18 2016 11:41
@omarshibli hey, was you able to resolve the problem or do you require some help?
@reactormonk for the model question, we currently only support the single direction, from specification to the code
But the question is very interesting, I already had a couple of situations i'd like to have this functionality. I'd create an issue for that
Simon Hafner
@reactormonk
Apr 18 2016 11:43
@slavaschmidt I actually found the other way too, reactormonk/play-swagger@a181d19
slavaschmidt
@slavaschmidt
Apr 18 2016 11:43
@reactormonk cool, I'll take a look
Simon Hafner
@reactormonk
Apr 18 2016 11:44
That only works for hardcoded values though.
case class JsObject(override val meta: TypeMeta) extends ProvidedType("JsObject", meta) with PrimitiveType {
   override val imports = Set("play.api.libs.json.JsObject")
 }
Nice talk btw.
slavaschmidt
@slavaschmidt
Apr 18 2016 11:44
for the merging question, we want to go into the opposite direction by splitting the plugin and providing a "plugin-in-the-plugin" infrastructure for parsers
Simon Hafner
@reactormonk
Apr 18 2016 11:45
Or just make a core and have the parsers depend on that, so you can go play-swagger-swagger and play-swagger-apib etc.?
slavaschmidt
@slavaschmidt
Apr 18 2016 11:45
that way you could keep the apiary part and anybody would be able to combine any parser with any code generator (we also plan to have multiple of them :)
yep, we were thinking about that, but this might be a little overwhelming in the case we will really have many code generators and spec formats
say, we already thinking about RAML and Akka-HTTP
this would give us 6 combinations :)
what i'm thinking about is just multiple plugin imports in the project file and a core which is able to combine them
i'm still on "vacation" until the next week, but will start to implement this after that
oh, you've seen that talk?
Simon Hafner
@reactormonk
Apr 18 2016 11:49
Maybe a better idea - simply go with a Seq[StrictModel], and people can use their own tasks to provide that. Aka swaggerModelGenerator := swaggerGen and the same for everything else.
Forth row.
Eh, go with Task[Seq[StrictModel]].
slavaschmidt
@slavaschmidt
Apr 18 2016 11:49
glad you liked it! I was a little bit confused not to have any questions
yep, something like that
Simon Hafner
@reactormonk
Apr 18 2016 11:50
It's hard to get people to ask questions. You have to hit the exact sweet spot of them not knowing the topic yet but having enough knowledge to understand it.
slavaschmidt
@slavaschmidt
Apr 18 2016 11:50
still thinking about that, ideally we want to be able to to that not only in sbt
but probably it would be good to start with
Simon Hafner
@reactormonk
Apr 18 2016 11:50
Why not? I think sbt is the perfect spot for that. Where else would you config builds?
slavaschmidt
@slavaschmidt
Apr 18 2016 11:51
sure, but if you think, say, that people might want to generate spring code from swagger spec... we already had such kind of questions :)
Simon Hafner
@reactormonk
Apr 18 2016 11:52
You can still do that with sbt, right?
slavaschmidt
@slavaschmidt
Apr 18 2016 11:52
but I think to start with SBT task is good
:D
not always, depends on the company
Simon Hafner
@reactormonk
Apr 18 2016 11:53
And since we're only stacking functions, you can also do that in any other build system that stacks functions.
slavaschmidt
@slavaschmidt
Apr 18 2016 11:53
some even have specific maven version requirements
yep
so, I still have to give a talk in QA conf in the Moscow at the end of the week, then I'll be back coding
sorry it takes so much time
I hacked in some comments so I know which types to return
Related: zalando/play-swagger#118
slavaschmidt
@slavaschmidt
Apr 18 2016 11:56
i've not looked at that yet, i will
for failures, we have a mapping from exception class name to the response code
for successes, we return a pair
Simon Hafner
@reactormonk
Apr 18 2016 11:56
I know. But it's untyped.
slavaschmidt
@slavaschmidt
Apr 18 2016 11:57
we kinda have a runtime check, but you're right
that's what i don't like
Simon Hafner
@reactormonk
Apr 18 2016 11:57
Anything against using an ADT?
slavaschmidt
@slavaschmidt
Apr 18 2016 11:57
no
just need to think about that
Simon Hafner
@reactormonk
Apr 18 2016 11:57
Ok, I'll implement it.
slavaschmidt
@slavaschmidt
Apr 18 2016 11:57
cool!
Simon Hafner
@reactormonk
Apr 18 2016 11:58
Doesn't look too difficult, and I think it would help coding.
slavaschmidt
@slavaschmidt
Apr 18 2016 11:59
to be hones i just don't use IDE for this kind of projects so i wasn't thinking in that direction :)
Simon Hafner
@reactormonk
Apr 18 2016 11:59
ensime.
Still helps you typecheck.
slavaschmidt
@slavaschmidt
Apr 18 2016 11:59
yep ADT idea looks great
ensime, i've heard about it at scalasphere but had an impression it's not really useful yet
do you use it?
Simon Hafner
@reactormonk
Apr 18 2016 12:03
Yup
goto-definition is the feature I use most, the typechecking is cool too. Editor?
slavaschmidt
@slavaschmidt
Apr 18 2016 12:03
sublime
will check, thanks for the tipp
slavaschmidt
@slavaschmidt
Apr 18 2016 12:09
seems like atom is a better choice. or emacs
Simon Hafner
@reactormonk
Apr 18 2016 12:11
sublime works too.
slavaschmidt
@slavaschmidt
Apr 18 2016 12:12
looks cool
emacs + vim :D
Simon Hafner
@reactormonk
Apr 18 2016 15:35
Any specific reason there's a Try in Try[(Int, Any)]?
... as default action type.
Well, I'm deleting the Try part and just generating ADT leaves for the errors too.
I hope you don't mind a bit of dependent typing.
slavaschmidt
@slavaschmidt
Apr 18 2016 19:05
nope, go on :)