Giter Club home page Giter Club logo

Comments (4)

github-actions avatar github-actions commented on July 20, 2024

PETOSS-307

from xero-openapi.

github-actions avatar github-actions commented on July 20, 2024

Thanks for raising an issue, a ticket has been created to track your request

from xero-openapi.

17twenty avatar 17twenty commented on July 20, 2024

In addition, after taking advice - I tried using redoc to reformat the YAML before parsing but that gets sad too:

$ redocly bundle --dereferenced  xero_accounting.yaml > new.yaml
bundling xero_accounting.yaml...
📦 Created a bundle for xero_accounting.yaml at stdout 267ms. 
$ go run github.com/getkin/kin-openapi/cmd/validate@latest -- new.yaml 
2023/06/23 11:56:27 error converting YAML to JSON: yaml: anchor 'ref_20' value contains itself
exit status 1

from xero-openapi.

karlskewes avatar karlskewes commented on July 20, 2024

After the linked issue was solved I was able to generate types using oapi-codegen:

# install v2.0
$ go install github.com/deepmap/oapi-codegen/v2/cmd/[email protected]

# create config.yaml with circular reference limit (potentially can lower)
$ cat ./config.yaml 
package: xero
generate:
  models: true
compatibility:
  circular-reference-limit: 10

# generate 
$ oapi-codegen -config ./config.yaml xero_accounting.yaml > accounting.go

accounting.go:

$ head -n 30 accounting.go
// Package xero provides primitives to interact with the openapi HTTP API.
//
// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0 DO NOT EDIT.
package xero

import (
	"bytes"
// snip

	"github.com/oapi-codegen/runtime"
	openapi_types "github.com/oapi-codegen/runtime/types"
)

const (
	OAuth2Scopes = "OAuth2.Scopes"
)

// Defines values for AccountBankAccountType.
const (
	AccountBankAccountTypeBANK       AccountBankAccountType = "BANK"
	AccountBankAccountTypeCREDITCARD AccountBankAccountType = "CREDITCARD"
	AccountBankAccountTypeEmpty      AccountBankAccountType = ""
	AccountBankAccountTypeNONE       AccountBankAccountType = "NONE"

from xero-openapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.