-
-
Notifications
You must be signed in to change notification settings - Fork 483
Closed
Description
Using with oapi-codegen I had errors trying to build out the Client from the code using:
#!/usr/bin/env
FILE=xero_accounting.yaml
ORIGINAL_STRIPPED=$(basename $FILE .yaml);
NEW=$(echo $ORIGINAL_STRIPPED | tr 'xero-' 'xero_' | sed 's/xero_//')
# Generate the API spec
echo Generating from "$ORIGINAL_STRIPPED"
mkdir -p "$PACKAGE_NAME/$NEW/"
oapi-codegen --package=main -generate=types,client -package "$PACKAGE_NAME" "$FILE" > "$PACKAGE_NAME/$NEW".gen.go
The output from that command being:
bash ./generator/scripts/golang/gen.sh
Generating from xero_accounting
error loading swagger spec in xero_accounting.yaml
: kin-openapi bug found: circular schema reference not handled - #/components/schemas/ExpenseClaim -> #/components/schemas/Payment -> #/components/schemas/CreditNote -> #/components/schemas/Payment -> #/components/schemas/Prepayment -> #/components/schemas/Allocation -> #/components/schemas/Prepayment -> #/components/schemas/Payment -> #/components/schemas/Invoice -> #/components/schemas/PaymentI followed up to use the latest kin-openapi as referenced in #764 but still see the below issue:
go run github.com/getkin/kin-openapi/cmd/validate@latest -- xero_accounting.yaml
go: downloading github.com/getkin/kin-openapi v0.118.0
go: downloading github.com/perimeterx/marshmallow v1.1.4
2023/06/23 11:10:58 Loading error: kin-openapi bug found: circular schema reference not handled - #/components/schemas/Overpayment -> #/components/schemas/Payment -> #/components/schemas/Overpayment -> #/components/schemas/Allocation -> #/components/schemas/Invoice -> #/components/schemas/Prepayment -> #/components/schemas/Payment -> #/components/schemas/BatchPayment -> #/components/schemas/Payment -> #/components/schemas/CreditNote -> #/components/schemas/Allocation -> #/components/schemas/Invoice -> #/components/schemas/CreditNote -> #/components/schemas/Payment
exit status 1Metadata
Metadata
Assignees
Labels
No labels