Skip to content

Allow setting globalState.spec without Generate#1174

Merged
jamietanna merged 1 commit into
oapi-codegen:masterfrom
derbylock:someInternalsExposure
Aug 23, 2023
Merged

Allow setting globalState.spec without Generate#1174
jamietanna merged 1 commit into
oapi-codegen:masterfrom
derbylock:someInternalsExposure

Conversation

@derbylock

@derbylock derbylock commented Aug 3, 2023

Copy link
Copy Markdown

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 jamietanna self-requested a review August 18, 2023 09:11
@jamietanna jamietanna added this to the v1.14.0 milestone Aug 18, 2023
@jamietanna

jamietanna commented Aug 18, 2023

Copy link
Copy Markdown
Member

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.
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.

2 participants