Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting globalState.spec without Generate #1174

Merged
merged 1 commit into from
Aug 23, 2023

Conversation

derbylock
Copy link

@derbylock derbylock commented Aug 3, 2023

We use oapi-codegen as a library.
E.g. we use public functions (e.g. codegen.OperationDefinitions()) inside our tool to make our specific additional code generation logic.
Currently the globalState.spec variable is used in refPathToGoType() and is set only in the Generate() function, so we have a panic when we use public functions without the Generate() invocation.

I suppose it is nice to have an ability to set the globalState.spec variable without the Generate() function invocation.

@jamietanna
Copy link
Member

jamietanna commented Aug 18, 2023

Looks interesting - I'll get a review shortly. I wasn't aware of anyone using the codegen functionality, without using the binary as-is, cool!

I notice that GitHub Actions hasn't triggered on this PR, which is odd 🤔

To allow consumers using oapi-codegen as a library.
@jamietanna jamietanna merged commit a80e681 into oapi-codegen:master Aug 23, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants