go-jira
go-jira copied to clipboard
How official API descriptions/definitions can help us with automation
From #200
Using official API descriptions/definitions
Jira provides a machine-readable API description/definition:
Jira Server
The Jira Server platform REST API resources are also documented in this WADL file: jira-rest-plugin.wadl.
Source: https://developer.atlassian.com/server/jira/platform/rest-apis/
Jira Cloud
Source: https://developer.atlassian.com/cloud/jira/platform/rest/v2/
Can we use this to
- generate API endpoints/structs?
- validate our code?
- check how "complete" we are?
Maybe this can be combined with the go generate
idea (see https://github.com/andygrunwald/go-jira/issues/480)
+1 on this, could use a go compiler directive in combination with https://github.com/deepmap/oapi-codegen to autogenerate the structs from the OpenAPI specs. Something like:
//go:generate oapi-codegen --package=main -generate=types -o ./types.gen.go https://developer.atlassian.com/cloud/jira/platform/swagger.v3.json
Thanks for the recommendation @justinhwang. I will have a look into it!