A simple go SDK for regula.
go get -u github.com/wu20230925/simple-regula-go
And then import to your application.
See the example how to use it.
Requires go 1.20+
Clone repo DocumentReader-web-openapi to local.
For generate code in Go by oapi-codegen, here are some changes:
- Edit rt.yml - remove components.schemas.ResultItem.discriminator node
- Edit rt-authenticity.yml - remove components.schemas.AuthenticityCheckResultItem.discriminator
- Edit index.yml:
/api/v2/transaction/{transaction_id}/process -> /api/v2/transaction/{transactionId}/process
/api/v2/transaction/{transaction_id} -> /api/v2/transaction/{transactionId}
/api/v2/transaction/{transaction_id}/results -> /api/v2/transaction/{transactionId}/results
/api/v2/transaction/{transaction_id}/file -> /api/v2/transaction/{transactionId}/file
/api/v2/tag/{tag_id} -> /api/v2/tag/{tagId}
Then run next command:
```bash
npx @redocly/openapi-cli@latest bundle index.yml > single.yml
it will generate single.yml.
oapi-codegen -package model -generate "types,skip-prune" [path of single.yml]> model/model.gen.go
Notion: You need to install oapi-codegen firstly.
Cause of oapi-codegen requires go1.20+, you can use v0.0.1-alpha under the version 1.20.(v0.0.1-alpha was manually edited.)