Title: New configuration concept: "presets" · Issue #1920 · oapi-codegen/oapi-codegen · GitHub
Open Graph Title: New configuration concept: "presets" · Issue #1920 · oapi-codegen/oapi-codegen
X Title: New configuration concept: "presets" · Issue #1920 · oapi-codegen/oapi-codegen
Description: Problem As we build new functionality into oapi-codegen, there are new features which should become the defaults, because they provide a much better experience. For instance, using the new nullable support, but there are other features t...
Open Graph Description: Problem As we build new functionality into oapi-codegen, there are new features which should become the defaults, because they provide a much better experience. For instance, using the new nullable...
X Description: Problem As we build new functionality into oapi-codegen, there are new features which should become the defaults, because they provide a much better experience. For instance, using the new nullable...
Opengraph URL: https://github.com/oapi-codegen/oapi-codegen/issues/1920
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"New configuration concept: \"presets\"","articleBody":"## Problem\n\nAs we build new functionality into `oapi-codegen`, there are new features which should become the defaults, because they provide a much better experience.\n\nFor instance, [using the new `nullable` support](https://github.com/oapi-codegen/oapi-codegen?tab=readme-ov-file#generating-nullable-types), but there are other features that are opt-in, such as those we are looking at making in [the 3.x release](https://github.com/oapi-codegen/oapi-codegen/issues?q=is%3Aissue%20state%3Aopen%20milestone%3Av3.0.0).\n\nHowever, [we try to avoid changing the generated code](https://github.com/oapi-codegen/oapi-codegen/blob/main/CONTRIBUTING.md#making-changes-that-tweak-generated-code) for new features, and only plan to change the existing templated code if strictly necessary (i.e. to fix a bug).\n\nSo in this case, there's no handy way to \"nudge\" users to use the new functionality, aside from them having to read the docs and opt-in.\n\nWaiting until 3.x (which will come with a slew of other breaking changes) is unlikely to be a good idea, especially as we have no idea when that will be (as noted in https://github.com/oapi-codegen/oapi-codegen/discussions/1606)\n\nHowever, we don't want to rely on users needing to do as much to get a better experience.\n\n## Solution\n\nInstead, we should _shamelessly_ take inspiration from [Renovate's presets](https://docs.renovatebot.com/key-concepts/presets/) and introduce a means for users to take pre-configured set of defaults (separate to the actual defaults when using `oapi-codegen` with minimal configuration)\n\nThese will have a slightly different approach for stability, where generated changes will be possible, due to it having a slightly different behaviour to the \"normal\" defaults.\n\nWe should also define the \"preset ladder\", to indicate when a feature could be promoted to a \"recommended\" option.\n\nInitial thoughts would be that a configuration item cannot enter the presets until at least 1 minor release later.\n\n## Out of scope\n\nIt will not be possible to create your own presets.\n\nThere will only be one preset, `config:recommended`.\n\nIt will be possible to use multiple presets (as an array format) but it will only be allowed to be a singleton, pending further decision on behaviour.\n\n","author":{"url":"https://github.com/jamietanna","@type":"Person","name":"jamietanna"},"datePublished":"2025-03-06T21:12:02Z","url":"https://github.com/oapi-codegen/oapi-codegen/issues/1920"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ea68ac4e-511b-f122-cce3-53f3820dfb46 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 918A:3F3090:2BF7FC7:39842B0:6AF9BD23 |
| html-safe-nonce | be59991e60e438635f41fd0a54b2bd78369cb679a7e7d038f093a032591fa91f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MThBOjNGMzA5MDoyQkY3RkM3OjM5ODQyQjA6NkFGOUJEMjMiLCJ2aXNpdG9yX2lkIjoiNDIwMzQzNjQxMjIzMTA3MzA1OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 35d8d67e4d2e094fb409cb0693bb6f4a3e3cf3fda8e2405d1878c1a0fa2a4122 |
| hovercard-subject-tag | issue:2901441647 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/oapi-codegen/oapi-codegen/1920/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3c49e37e080d11f58857597f7d2ee202c60c3c9db8eeb63ddc9b558c95022880/oapi-codegen/oapi-codegen/issues/1920 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3c49e37e080d11f58857597f7d2ee202c60c3c9db8eeb63ddc9b558c95022880/oapi-codegen/oapi-codegen/issues/1920 |
| og:image:alt | Problem As we build new functionality into oapi-codegen, there are new features which should become the defaults, because they provide a much better experience. For instance, using the new nullable... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jamietanna |
| hostname | github.com |
| expected-hostname | github.com |
| None | 612d3e6ffd693e7ea8d9fcf452370995872baef31d825b1fedef704cd3d24ac7 |
| turbo-cache-control | no-preview |
| go-import | github.com/oapi-codegen/oapi-codegen git https://github.com/oapi-codegen/oapi-codegen.git |
| octolytics-dimension-user_id | 142752710 |
| octolytics-dimension-user_login | oapi-codegen |
| octolytics-dimension-repository_id | 173009358 |
| octolytics-dimension-repository_nwo | oapi-codegen/oapi-codegen |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 173009358 |
| octolytics-dimension-repository_network_root_nwo | oapi-codegen/oapi-codegen |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 072e34035c13c31543fba9f025cbbbda4210dae4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width