News for hackers. Stuff that matters.
Re:Goa: Design-First API Generation by niftich on Wednesday June 29, 2016 @06:22PM (#12005247)
They approach the same problem from opposite directions. Goa's DSL will let you code a server, and then export a Swagger spec that clients can consume (and codegen their end from).

Whereas Swagger's code generators start with the Swagger spec already written. You can use them to generate a server, which will create the scaffolding but leave you with the logic to implement.

Re:Goa: Design-First API Generation by tokenizerrr on Wednesday June 29, 2016 @06:24PM (#12005265)
Swagger can also generate its spec from an already written server, and that's how I'm using it primarily.
Re:Goa: Design-First API Generation by niftich on Wednesday June 29, 2016 @06:30PM (#12005311)
Would you mind linking to some docs on how to do that?

I only found this quote, which hints that it's a manual process (if your framework doesn't produce the spec):

"Either you create the definition manually (using the same Swagger Editor mentioned above), or if you are using one of the supported frameworks (JAX-RS, node.js, etc) [1], you can get the Swagger definition generated automatically for you." [2]

[1] http://swagger.io/open-source-integrations/ [2] http://swagger.io/getting-started/

Re:Goa: Design-First API Generation by wing328hk on Thursday June 30, 2016 @02:23AM (#12006928)
There are many plug-ins to to generate OpenAPI/Swagger spec from annotations in the source code.

For C#, please try https://github.com/domaindrivendev/Swashbuckle

For PHP, please try https://github.com/zircote/swagger-php

For other langauges, just do a google search on "{lang} swagger" and you will probably find something useful.

Re:Goa: Design-First API Generation by tokenizerrr on Wednesday June 29, 2016 @06:45PM (#12005376)
I'm using Java Spring (so JAX-RS) and use https://github.com/swagger-api/swagger-core. To further customize it I use the annotations https://github.com/swagger-api/swagger-core/wiki/Annotations...