SlideShare a Scribd company logo
CyberAgent, Inc. All Rights Reserved.
goa :: Design-first API Generation
2015 December 4th
Date : 2017 March 10 Presenter : Y.Sugiyama
Who are you?01
Introduction Who are you?01
CyberAgent(2011~)
• Ameba Pigg
• Java, node.js, MongoDB
• Takusuta(Live Streaming)
• Golang(gin), node.js, python, MongoDB,and various on live streaming.
• Golang, node.js, a little Scala.
Yoshinori Sugiyama,age:36,github:syama666
What is goa?02
goa has three parts What is goa?02
• a Go DSL for describing the microservice API
• a tool for generating code and documentation from design DSL
• a library to support the implementation of microservices
design03
DSL examples for API design design03
// GET /v1/kings?page=1&perPage=10&sort=-kingsId
var _ = Resource("v1_kings", func() {
BasePath("/v1/kings")
Action("list", func() {
Routing(GET(""))
Description(”get kings list")
Param("page", Integer, "e.g.) page=1", func() {
Default(1)
})
Param("perPage", Integer, "e.g.) perPage=10", func()
{
Default(10)
})
Param("sort", String, "e.g.) sort=kingId or sort=-
kingId", func() {
Pattern("^-?[0-9a-zA-Z]+$")
Default("-kingId")
})
Response(OK, func() {
Media(ResponseKings)
})
DSL examples for API design design03
// PUT/v1/kings/1192
var _ = Resource("v1_kings", func() {
BasePath("/v1/kings")
Action("update", func () {
Routing(PUT("/:kingId"))
Description(”update
a king")
Params(func() {
Param("kingId", Integer)
})
Payload(UpdateKing)
Response(OK, func()
{
Media(ResponseOneKing)
})
})
DSL examples for API design design03
// base king type dsl
var baseKing = Type("baseKing", func() {
Attribute("kingId", Integer, func() {
Example(1192)
})
Attribute("name", String, func() {
Example("Louis XIV")
})
Attribute("age", Integer, func() {
Example(76)
})
})
DSL examples for API design design03
// Japanese Lord type dsl
var japaneseLord = Type("baseKing", func() {
Reference(baseKing)
Attribute("kingId")
Attribute("name")
Attribute("age")
Attribute("birthPlace", String, func(){
Example(“江戸”)
})
Required(
"kingId",
"name",
"age",
"birthPlace",
)
})
DSL to Swagger design03
Goa DSL to Swagger.json By goagen
API design lifecycle design03
Generating code and docs04
goagen’s sub commands Generating04
• main
• main.go and controller scaffolding
• controller
• only controller scaffolding
• app
• validation, context, etc
• client
• golang client
• swagger
• swagger json
• js
• javascript client
• schema
• JSON schema
directory/package structure Generating04
• main.go
• controller/
• gen/
• app/
• contexts.go
• controllers.go
• hrefs.go
• user_types.go
• media_types.go
• swagger/
• swagger.json
• swagger.yml
• design/
directory/package structure Generating04
• main.go
• controller/
• gen/
• app/
• contexts.go
• controllers.go
• hrefs.go
• user_types.go
• media_types.go
• swagger/
• swagger.json
• swagger.yml
• design/
main
app
swagger
directory/package structure Generating04
• main.go
• controller/
• gen/
• app/
• contexts.go
• controllers.go
• hrefs.go
• user_types.go
• media_types.go
• swagger/
• swagger.json
• swagger.yml
• design/
auto-generated, do not modify
Only scaffold, goa do not update
05 Overall view
lib,generated, and yours Overall view
05
Components structure Overall view
05
API sequence Overall view
05
06 digest
cool digest06
• Generating swagger docs.
• Generating validation-code, and scaffolding some.
• Output a better code than go-swagger -> https://github.com/go-
swagger/go-swagger
not cool digest06
• You need implements logic of convert from your model sturct to goa-
generated struct.
• If you want to customize the error response, you have to hack goa -
middleware.
https://github.com/goadesign/goa/issues/1076

More Related Content

Similar to goa Design first API Generation

goaを使った開発TIPS@六本木一丁目
goaを使った開発TIPS@六本木一丁目goaを使った開発TIPS@六本木一丁目
goaを使った開発TIPS@六本木一丁目
jumpei chikamori
 
Better APIs with GraphQL
Better APIs with GraphQL Better APIs with GraphQL
Better APIs with GraphQL
Josh Price
 
Serverless - Developers.IO 2019
Serverless - Developers.IO 2019Serverless - Developers.IO 2019
Serverless - Developers.IO 2019
Shuji Watanabe
 
MongoDB Basics
MongoDB BasicsMongoDB Basics
MongoDB Basics
Sarang Shravagi
 
初心者向けGAE/Java説明資料
初心者向けGAE/Java説明資料初心者向けGAE/Java説明資料
初心者向けGAE/Java説明資料
Shinichi Ogawa
 
cadec-2017-golang
cadec-2017-golangcadec-2017-golang
cadec-2017-golang
TiNguyn863920
 
JSON-B for CZJUG
JSON-B for CZJUGJSON-B for CZJUG
JSON-B for CZJUG
Dmitry Kornilov
 
Scala at Treasure Data
Scala at Treasure DataScala at Treasure Data
Scala at Treasure Data
Taro L. Saito
 
Building a spa_in_30min
Building a spa_in_30minBuilding a spa_in_30min
Building a spa_in_30min
ArangoDB Database
 
Building a spa_in_30min
Building a spa_in_30minBuilding a spa_in_30min
Building a spa_in_30min
Michael Hackstein
 
Gaej For Beginners
Gaej For BeginnersGaej For Beginners
Gaej For Beginners
Shinichi Ogawa
 
DIとトレイとによるAndroid開発の効率化
DIとトレイとによるAndroid開発の効率化DIとトレイとによるAndroid開発の効率化
DIとトレイとによるAndroid開発の効率化
Tomoharu ASAMI
 
マイクロにしすぎた結果がこれだよ!
マイクロにしすぎた結果がこれだよ!マイクロにしすぎた結果がこれだよ!
マイクロにしすぎた結果がこれだよ!
mosa siru
 
Swagger / Quick Start Guide
Swagger / Quick Start GuideSwagger / Quick Start Guide
Swagger / Quick Start Guide
Andrii Gakhov
 
Crafting Evolvable Api Responses
Crafting Evolvable Api ResponsesCrafting Evolvable Api Responses
Crafting Evolvable Api Responses
darrelmiller71
 
Building Serverless APIs (January 2017)
Building Serverless APIs (January 2017)Building Serverless APIs (January 2017)
Building Serverless APIs (January 2017)
Julien SIMON
 
Introduction to Swagger
Introduction to SwaggerIntroduction to Swagger
Introduction to Swagger
Knoldus Inc.
 
IVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & Mobile
IVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & MobileIVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & Mobile
IVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & Mobile
Amazon Web Services Japan
 
Document Model for High Speed Spark Processing
Document Model for High Speed Spark ProcessingDocument Model for High Speed Spark Processing
Document Model for High Speed Spark Processing
MongoDB
 
How to Contribute to Apache Usergrid
How to Contribute to Apache UsergridHow to Contribute to Apache Usergrid
How to Contribute to Apache Usergrid
David M. Johnson
 

Similar to goa Design first API Generation (20)

goaを使った開発TIPS@六本木一丁目
goaを使った開発TIPS@六本木一丁目goaを使った開発TIPS@六本木一丁目
goaを使った開発TIPS@六本木一丁目
 
Better APIs with GraphQL
Better APIs with GraphQL Better APIs with GraphQL
Better APIs with GraphQL
 
Serverless - Developers.IO 2019
Serverless - Developers.IO 2019Serverless - Developers.IO 2019
Serverless - Developers.IO 2019
 
MongoDB Basics
MongoDB BasicsMongoDB Basics
MongoDB Basics
 
初心者向けGAE/Java説明資料
初心者向けGAE/Java説明資料初心者向けGAE/Java説明資料
初心者向けGAE/Java説明資料
 
cadec-2017-golang
cadec-2017-golangcadec-2017-golang
cadec-2017-golang
 
JSON-B for CZJUG
JSON-B for CZJUGJSON-B for CZJUG
JSON-B for CZJUG
 
Scala at Treasure Data
Scala at Treasure DataScala at Treasure Data
Scala at Treasure Data
 
Building a spa_in_30min
Building a spa_in_30minBuilding a spa_in_30min
Building a spa_in_30min
 
Building a spa_in_30min
Building a spa_in_30minBuilding a spa_in_30min
Building a spa_in_30min
 
Gaej For Beginners
Gaej For BeginnersGaej For Beginners
Gaej For Beginners
 
DIとトレイとによるAndroid開発の効率化
DIとトレイとによるAndroid開発の効率化DIとトレイとによるAndroid開発の効率化
DIとトレイとによるAndroid開発の効率化
 
マイクロにしすぎた結果がこれだよ!
マイクロにしすぎた結果がこれだよ!マイクロにしすぎた結果がこれだよ!
マイクロにしすぎた結果がこれだよ!
 
Swagger / Quick Start Guide
Swagger / Quick Start GuideSwagger / Quick Start Guide
Swagger / Quick Start Guide
 
Crafting Evolvable Api Responses
Crafting Evolvable Api ResponsesCrafting Evolvable Api Responses
Crafting Evolvable Api Responses
 
Building Serverless APIs (January 2017)
Building Serverless APIs (January 2017)Building Serverless APIs (January 2017)
Building Serverless APIs (January 2017)
 
Introduction to Swagger
Introduction to SwaggerIntroduction to Swagger
Introduction to Swagger
 
IVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & Mobile
IVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & MobileIVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & Mobile
IVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & Mobile
 
Document Model for High Speed Spark Processing
Document Model for High Speed Spark ProcessingDocument Model for High Speed Spark Processing
Document Model for High Speed Spark Processing
 
How to Contribute to Apache Usergrid
How to Contribute to Apache UsergridHow to Contribute to Apache Usergrid
How to Contribute to Apache Usergrid
 

Recently uploaded

Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdfBaha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
XfilesPro
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
Alina Yurenko
 
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Paul Brebner
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Julian Hyde
 
Transforming Product Development using OnePlan To Boost Efficiency and Innova...
Transforming Product Development using OnePlan To Boost Efficiency and Innova...Transforming Product Development using OnePlan To Boost Efficiency and Innova...
Transforming Product Development using OnePlan To Boost Efficiency and Innova...
OnePlan Solutions
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
ToXSL Technologies
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.
Maitrey Patel
 
The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024
Yara Milbes
 
Photoshop Tutorial for Beginners (2024 Edition)
Photoshop Tutorial for Beginners (2024 Edition)Photoshop Tutorial for Beginners (2024 Edition)
Photoshop Tutorial for Beginners (2024 Edition)
alowpalsadig
 
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
The Third Creative Media
 
Manyata Tech Park Bangalore_ Infrastructure, Facilities and More
Manyata Tech Park Bangalore_ Infrastructure, Facilities and MoreManyata Tech Park Bangalore_ Infrastructure, Facilities and More
Manyata Tech Park Bangalore_ Infrastructure, Facilities and More
narinav14
 
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
kalichargn70th171
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
Patrick Weigel
 
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
kgyxske
 
Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...
Paul Brebner
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
sjcobrien
 
What’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete RoadmapWhat’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete Roadmap
Envertis Software Solutions
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 

Recently uploaded (20)

Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdfBaha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
 
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
 
Transforming Product Development using OnePlan To Boost Efficiency and Innova...
Transforming Product Development using OnePlan To Boost Efficiency and Innova...Transforming Product Development using OnePlan To Boost Efficiency and Innova...
Transforming Product Development using OnePlan To Boost Efficiency and Innova...
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
 
ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.
 
The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024
 
Photoshop Tutorial for Beginners (2024 Edition)
Photoshop Tutorial for Beginners (2024 Edition)Photoshop Tutorial for Beginners (2024 Edition)
Photoshop Tutorial for Beginners (2024 Edition)
 
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
 
Manyata Tech Park Bangalore_ Infrastructure, Facilities and More
Manyata Tech Park Bangalore_ Infrastructure, Facilities and MoreManyata Tech Park Bangalore_ Infrastructure, Facilities and More
Manyata Tech Park Bangalore_ Infrastructure, Facilities and More
 
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
 
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
 
Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
 
What’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete RoadmapWhat’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete Roadmap
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 

goa Design first API Generation

  • 1. CyberAgent, Inc. All Rights Reserved. goa :: Design-first API Generation 2015 December 4th Date : 2017 March 10 Presenter : Y.Sugiyama
  • 3. Introduction Who are you?01 CyberAgent(2011~) • Ameba Pigg • Java, node.js, MongoDB • Takusuta(Live Streaming) • Golang(gin), node.js, python, MongoDB,and various on live streaming. • Golang, node.js, a little Scala. Yoshinori Sugiyama,age:36,github:syama666
  • 5. goa has three parts What is goa?02 • a Go DSL for describing the microservice API • a tool for generating code and documentation from design DSL • a library to support the implementation of microservices
  • 7. DSL examples for API design design03 // GET /v1/kings?page=1&perPage=10&sort=-kingsId var _ = Resource("v1_kings", func() { BasePath("/v1/kings") Action("list", func() { Routing(GET("")) Description(”get kings list") Param("page", Integer, "e.g.) page=1", func() { Default(1) }) Param("perPage", Integer, "e.g.) perPage=10", func() { Default(10) }) Param("sort", String, "e.g.) sort=kingId or sort=- kingId", func() { Pattern("^-?[0-9a-zA-Z]+$") Default("-kingId") }) Response(OK, func() { Media(ResponseKings) })
  • 8. DSL examples for API design design03 // PUT/v1/kings/1192 var _ = Resource("v1_kings", func() { BasePath("/v1/kings") Action("update", func () { Routing(PUT("/:kingId")) Description(”update a king") Params(func() { Param("kingId", Integer) }) Payload(UpdateKing) Response(OK, func() { Media(ResponseOneKing) }) })
  • 9. DSL examples for API design design03 // base king type dsl var baseKing = Type("baseKing", func() { Attribute("kingId", Integer, func() { Example(1192) }) Attribute("name", String, func() { Example("Louis XIV") }) Attribute("age", Integer, func() { Example(76) }) })
  • 10. DSL examples for API design design03 // Japanese Lord type dsl var japaneseLord = Type("baseKing", func() { Reference(baseKing) Attribute("kingId") Attribute("name") Attribute("age") Attribute("birthPlace", String, func(){ Example(“江戸”) }) Required( "kingId", "name", "age", "birthPlace", ) })
  • 11. DSL to Swagger design03 Goa DSL to Swagger.json By goagen
  • 14. goagen’s sub commands Generating04 • main • main.go and controller scaffolding • controller • only controller scaffolding • app • validation, context, etc • client • golang client • swagger • swagger json • js • javascript client • schema • JSON schema
  • 15. directory/package structure Generating04 • main.go • controller/ • gen/ • app/ • contexts.go • controllers.go • hrefs.go • user_types.go • media_types.go • swagger/ • swagger.json • swagger.yml • design/
  • 16. directory/package structure Generating04 • main.go • controller/ • gen/ • app/ • contexts.go • controllers.go • hrefs.go • user_types.go • media_types.go • swagger/ • swagger.json • swagger.yml • design/ main app swagger
  • 17. directory/package structure Generating04 • main.go • controller/ • gen/ • app/ • contexts.go • controllers.go • hrefs.go • user_types.go • media_types.go • swagger/ • swagger.json • swagger.yml • design/ auto-generated, do not modify Only scaffold, goa do not update
  • 19. lib,generated, and yours Overall view 05
  • 23. cool digest06 • Generating swagger docs. • Generating validation-code, and scaffolding some. • Output a better code than go-swagger -> https://github.com/go- swagger/go-swagger
  • 24. not cool digest06 • You need implements logic of convert from your model sturct to goa- generated struct. • If you want to customize the error response, you have to hack goa - middleware. https://github.com/goadesign/goa/issues/1076