go-jira icon indicating copy to clipboard operation
go-jira copied to clipboard

How official API descriptions/definitions can help us with automation

Open andygrunwald opened this issue 2 years ago • 2 comments

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)

andygrunwald avatar Aug 20 '22 16:08 andygrunwald

+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

justinhwang avatar Jun 06 '23 16:06 justinhwang

Thanks for the recommendation @justinhwang. I will have a look into it!

andygrunwald avatar Jun 14 '23 08:06 andygrunwald