oapi-codegen icon indicating copy to clipboard operation
oapi-codegen copied to clipboard

Add fallback for old configuration style

Open jamietanna opened this issue 3 years ago • 2 comments

As a means to avoid the breaking changes we introduced in v1.11.0, where the new-style configuration was made the default, we can tweak our heuristic for how we work out what configuration is in use by only using the new-style config if the new --config flag is used.

This change in itself is non-breaking, and makes it possible to continue using the old configuration arguments, as long as you don't provide the new --config flag.

Similar to thoughts in #629, but does not require a revert.

Closes #629.

jamietanna avatar Jul 29 '22 09:07 jamietanna

So we will break people who updated :)

Let me do a couple of experiments first. I want to see whether we can correctly infer config file structure just by parsing the config.

deepmap-marcinr avatar Aug 10 '22 13:08 deepmap-marcinr

Thanks Marcin, but no, no one gets broken 👏🏽

This allows people who are using the --old-config-style to simply remove that flag and work as before, folks who've not yet updated to the latest version will be able to continue using the old version, and folks who are using the new --config can continue.

There are a few places we use both styles of arguments, hence a bit more comfort in what I'm saying, and happy to hear how your own investigations go to see if there are any gaps!

jamietanna avatar Aug 10 '22 15:08 jamietanna

Hey @deepmap-marcinr just thought I'd check in to see if you'd had a chance to do any further testing to see if this would be a good option for making the "old config" work?

jamietanna avatar Sep 07 '22 21:09 jamietanna

What do you think of this? https://github.com/deepmap/oapi-codegen/pull/747

deepmap-marcinr avatar Sep 08 '22 18:09 deepmap-marcinr