optionable_codegen 0.15.0

proc_macro2 functions for the derive macro and codegen implementations in the `optionable_derive` crate to derive nested structs/enums with all subfields being optional (e.g. for patches or Kubernetes server side apply).
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.15.0]https://github.com/ngergs/optionable/compare/optionable_codegen-v0.14.2...optionable_codegen-v0.15.0 - 2026-06-18

### Added

- [**breaking**] split kube feature the internal codegen create into kube3 and kube4

### Fixed

- kube3/kube4 feature split fixes
- add special case handling for k8s rust field names
- dependency updates

### Other

- semver version adjustments
- release

## [0.14.3]https://github.com/ngergs/optionable/compare/optionable_codegen-v0.14.2...optionable_codegen-v0.14.3 - 2026-06-17

### Fixed

- add special case handling for k8s rust field names
- dependency updates

## [0.14.2]https://github.com/ngergs/optionable/compare/optionable_codegen-v0.14.1...optionable_codegen-v0.14.2 - 2026-05-04

### Fixed

- skip required fields during serializing if they are `Option::None`

## [0.14.1]https://github.com/ngergs/optionable/compare/optionable_codegen-v0.14.0...optionable_codegen-v0.14.1 - 2026-05-03

### Added

- granular deepmerge handling
- merge behaviour `ignore`
- working deepmerge and mapkeyseq derives
- codegen for `MapKeysEq`
- add deepmerge to optionable_derive
- deepmerge implementation derive

### Fixed

- adjust OptionableConvert::merge implementation for k8s-openapi::List
- dependency updates
- k8s-openapi list deepmerge
- handle PersistenVolumeSpec.claim_ref special case for deepmerge codegen
- codegen enum handlung for k8s-openapi deepmerge
- regenerate k8s-openapi (fixed merge beaviors)
- handle references for kubernetes openapi spec
- kubernetes openapi parsing always evaluate schema extensions (for ref and embedded schemas)
- k8s openapi reference resolution
- handle option wrapped types for deepmerge derive
- add `ignore` merge behaviour for k8s-openapi api envelope phantomdata helper
- tests + deepmerge derive bugfixes
- working tests for plain deepmerge + bugfixes

### Other

- generalize k8s_openapi package name in codegen
- more deepmerge special cases
- no deepmerge impl for Patch
- also derive deepmerge for k8s-openapi enums
- merge behavior special case handling
- hyphen handling for k8s openapi matching to k8s_openapi (rust) paths
- codegen fixes
- k8s openapi parsing fixes (reference handling)
- rm openapi-utils (have to implement lookup ourselves)
- use openapi-utils to follow dereferenced references in k8s-openapi codegen
- openapi-utils for k8s-openapi codegen
- adjust k8s openapi parsing
- codegen
- codegen
- codegen
- adjust k8s-openapi codegen to derive DeepMerge and MapsKeysEq for optiones types
- docs
- add visitor to support calling other derives like DeepMerge or MapKeysEq in codegen binaries
- test
- clippy
- split up visitors
- enum deepmerge todo fixes
- adjusted todo
- deepmerge enum support
- deepnum merge enum impl
- first test for deepmerge and very very basic first working output
- simplify deepmerge visitor result type
- start implementing DeepMerge codegen using syn visitor
- deepmerge derive macro

## [0.14.0]https://github.com/ngergs/optionable/compare/optionable_codegen-v0.13.2...optionable_codegen-v0.14.0 - 2026-04-14

### Added

- generate atomic merge attribute for k8s map types where specified by upstream openapi spec
- derive macro for `OptionableMapKeysEq` (and rename of that trait)
- add codegen support for other merge types (todo: tests, derive impl, docs)
- [**breaking**] k8s codegen keeps fields required that are key fields for lists with map type merge behavior
- preserve doc comments for generated optioned types
- [**breaking**] use self-resolving container types for derive macro output
- [**breaking**] self-resolve fulls self-resolving container-types for derive macro

### Fixed

- missing self_resolving condition for simplified merge
- deref modifier for merge of already optioned types
- codegen for OptionableConvert::merge for already Option wrapped types
- correct option handling for adjusted merge logic
- malformed output for multiple merge_map_key
- move `map_key` derive logic into `Optionable` derive macro
- tests for custom merge behaviour + bugfixes
- error handling for unsupported merge type setting combinations

### Other

- clippy
- determine map type when parsing upstream k8s openapi spec
- rename merge options
- typo
- test adjustments
- update codegen tests
- restore codegen optimization for plain self-resolving types
- simplify merge codegen implementation
- todo
- error msg for unsupported merge behaviors
- refactor merge behaviour unsupported case handling
- set merge type for k8s openapi
- adjust k8s openapi codegen to add merge type where specified by upstream openapi spec
- adjust k8s-openapi codegen to mark merge map keys as such
- rename merge field attribute
- adjust test
- adjust codegen to support various merge_type behaviors (logic still missing)
- handle rust field mapping for parsed k8s openapi schema identifiers
- pass output path to codegen visitors, simplify k8s openapi spec parsing
- add kubernetes openapi parsing to k8s-openapi codegen (not utilized yet)

## [0.13.2]https://github.com/ngergs/optionable/compare/optionable_codegen-v0.13.1...optionable_codegen-v0.13.2 - 2026-03-19

### Other

- cargo fmt
- clippy
- fmt
- split codegen derive  function up a bit
- split codegen tests into individual functions for better failure reporting

## [0.13.1]https://github.com/ngergs/optionable/compare/optionable_codegen-v0.13.0...optionable_codegen-v0.13.1 - 2026-03-08

### Fixed

- dependency updates

## [0.13.0]https://github.com/ngergs/optionable/compare/optionable_codegen-v0.12.1...optionable_codegen-v0.13.0 - 2026-01-14

### Added

- [**breaking**] drop k8s-openapi v0.26 support
- use kube3 as feature and package path identifier for the kube v3 support
- [**breaking**] rework kube derive tooling

### Fixed

- dependency updates
- [**breaking**] remove k8s-openapi version from package path

## [0.12.1]https://github.com/ngergs/optionable/compare/optionable_codegen-v0.12.0...optionable_codegen-v0.12.1 - 2026-01-13

### Other

- simplify codegen
- simplify codegen

## [0.12.0]https://github.com/ngergs/optionable/compare/optionable_codegen-v0.11.1...optionable_codegen-v0.12.0 - 2025-12-24

### Fixed

- [**breaking**] use same attribute style for option_wrap as for other configs

## [0.11.1]https://github.com/ngergs/optionable/compare/optionable_codegen-v0.11.0...optionable_codegen-v0.11.1 - 2025-12-23

### Added

- add type-level `option-wrap` derive argument

## [0.10.2]https://github.com/ngergs/optionable/compare/optionable_codegen-v0.10.1...optionable_codegen-v0.10.2 - 2025-12-17

### Fixed

- avoid a where-clause clone during codegen

### Other

- simplify where-clause codegen

## [0.10.1]https://github.com/ngergs/optionable/compare/optionable_codegen-v0.10.0...optionable_codegen-v0.10.1 - 2025-12-15

### Fixed

- move `api_version` and `kind` fields for kubernetes resource types to the front

## [0.10.0]https://github.com/ngergs/optionable/compare/optionable_codegen-v0.9.4...optionable_codegen-v0.10.0 - 2025-12-14

### Added

- [**breaking**] rework k8s api envelope serialization/deserialization

### Other

- document crd roundtrip issue

## [0.9.4]https://github.com/ngergs/optionable/compare/optionable_codegen-v0.9.3...optionable_codegen-v0.9.4 - 2025-12-10

### Added

- support deserialization for QuantityAc from int following upstream

### Fixed

- dependency updates

### Other

- comment regarding crd stackoverflow

## [0.9.3]https://github.com/ngergs/optionable/compare/optionable_codegen-v0.9.2...optionable_codegen-v0.9.3 - 2025-12-09

### Fixed

- k8s-openapi various serialization/deserialization special case handling fixes

## [0.9.2]https://github.com/ngergs/optionable/compare/optionable_codegen-v0.9.1...optionable_codegen-v0.9.2 - 2025-12-08

### Fixed

- special case serde fix for $ref fields

## [0.9.1]https://github.com/ngergs/optionable/compare/optionable_codegen-v0.9.0...optionable_codegen-v0.9.1 - 2025-12-04

### Other

- refactor codegen
- simplify codegen code

## [0.9.0]https://github.com/ngergs/optionable/compare/optionable_codegen-v0.8.1...optionable_codegen-v0.9.0 - 2025-12-02

### Added

- [**breaking**] unseal `OptionedConvert`, drop blanket implementation, add `optioned_type` derive field attribute

### Fixed

- OptionableConvert for k8s-openapi watch event broke compilation
- regenerate k8s-openapi generated code

## [0.8.1]https://github.com/ngergs/optionable/compare/optionable_codegen-v0.8.0...optionable_codegen-v0.8.1 - 2025-12-01

### Other

- set Cargo edition, rust version, license and repo in workspace settings

## [0.8.0]https://github.com/ngergs/optionable/compare/optionable_codegen-v0.7.7...optionable_codegen-v0.8.0 - 2025-11-30

### Added

- [**breaking**] derived optionable implementation for plain enums to itself

### Fixed

- document (and verify in release gha) minimal rust version

## [0.7.7]https://github.com/ngergs/optionable/compare/optionable_codegen-v0.7.6...optionable_codegen-v0.7.7 - 2025-11-30

### Fixed

- reworked where clause broken for adding multiple bounds to existing constraint

## [0.7.6]https://github.com/ngergs/optionable/compare/optionable_codegen-v0.7.5...optionable_codegen-v0.7.6 - 2025-11-30

### Added

- full support unsized generic types for convert

## [0.7.5]https://github.com/ngergs/optionable/compare/optionable_codegen-v0.7.4...optionable_codegen-v0.7.5 - 2025-11-22

### Fixed

- avoid some unecessary clones during derive/codegen
- simplify generated/derived code by using `PhantomData<Self>` for the api envelope

## [0.7.4]https://github.com/ngergs/optionable/compare/optionable_codegen-v0.7.3...optionable_codegen-v0.7.4 - 2025-11-12

### Fixed

- for kube/k8s-openapi use #[serde(rename_all_fields="...")] instead of rename_all for enums

## [0.7.3]https://github.com/ngergs/optionable/compare/optionable_codegen-v0.7.2...optionable_codegen-v0.7.3 - 2025-11-11

### Added

- optionable::kube::deserialize_envelope function to verify api envelope

## [0.7.2]https://github.com/ngergs/optionable/compare/optionable_codegen-v0.7.1...optionable_codegen-v0.7.2 - 2025-11-10

### Fixed

- merge derives from the derive, kube and k8s_openapi helper attributes
- forward serde(rename_all) for kube helper instead of defaulting to camelCase

## [0.7.1]https://github.com/ngergs/optionable/compare/optionable_codegen-v0.7.0...optionable_codegen-v0.7.1 - 2025-11-10

### Added

- filter out `Optionable` out of forward derive attributes

### Other

- docs, update example

## [0.7.0]https://github.com/ngergs/optionable/compare/optionable_codegen-v0.6.0...optionable_codegen-v0.7.0 - 2025-11-09

### Added

- granular option to copy over specified helper attributes to the optioned type

### Fixed

- [**breaking**] optionable kube/k8s_openapi no longer automatically add serde untagged

### Other

- more involved custom resource example utilizing enums and serde rename

## [0.6.0]https://github.com/ngergs/optionable/compare/optionable_codegen-v0.4.3...optionable_codegen-v0.5.0 - 2025-11-08

### Added

- Kubernetes server side apply support (see next two items).
- Generated optioned types for all types from [`k8s-openapi`[(https://crates.io/crates/k8s-openapi)
- Support for deriving optioned types for [`kube`]https://docs.rs/kube/latest/kube/ CustomResources.

### Fixed

- [**breaking**] moved the error type from `optionable::optionable::Error` to `optionable::Error`
- use DeserializeOwned as generic type bound for optioned Deserialize-derives
- simplify generated code (use less explicit associated types)

## [0.5.0]https://github.com/ngergs/optionable/compare/optionable_codegen-v0.4.3...optionable_codegen-v0.5.0 - 2025-10-27

### Fixed

- mv cli code to separate unpublished crate
- clippy

## [0.4.3]https://github.com/ngergs/optionable/compare/optionable_codegen-v0.4.2...optionable_codegen-v0.4.3 - 2025-10-25

### Fixed

- `replacement-crate` codegen options also adjusts where clauses

## [0.4.2]https://github.com/ngergs/optionable/compare/optionable_codegen-v0.4.1...optionable_codegen-v0.4.2 - 2025-10-23

### Added

- codegen/derive: add type bounds for requested `derive` of the optioned type

### Fixed

- simplify codegen
- remove some `clone`-calls from codegen
- error on misused `optionable_attr` helper attribute
- skip where_clause checks if no generic parameters are present
- simplify where clause codegen implementation

### Other

- restructure codegen code

## [0.4.1]https://github.com/ngergs/optionable/compare/optionable_codegen-v0.4.0...optionable_codegen-v0.4.1 - 2025-10-21

### Added

- relax type restrictions for derived types with generic parameter

## [0.4.0]https://github.com/ngergs/optionable/compare/optionable_codegen-v0.3.0...optionable_codegen-v0.4.0 - 2025-10-18

### Added

- also check for full core import path for `is_option` check
- [**breaking**] std and alloc features to support opting-out of linking to the stdlib
- update self-resolving types

### Fixed

- clippy

### Other

- fmt

## [0.3.0]https://github.com/ngergs/optionable/compare/optionable_codegen-v0.2.0...optionable_codegen-v0.3.0 - 2025-10-15

### Added

- implement `Optionable` for ()

### Fixed

- document feature-gated derive macro and impls
- [**breaking**] refactor derive_optionable to avoid Cow in the fn signature

## [0.2.0]https://github.com/ngergs/optionable/compare/optionable_codegen-v0.1.3...optionable_codegen-v0.2.0 - 2025-10-10

### Added

- generalize `Optionable` trait to unsized
- codegen option to prefix type path for generated `Optionable` impl
- codegen settings/flags for targetting optionable
- codegen option to adjust the crate name used for the `Optionable` traits
- rework codegen to start from all files and follow internal module included recursively

### Fixed

- pass codegen flags through for subfolders
- codegen internal fn naming
- simplify derive code
- no automatically_derived on struct/enum definitions, refactor derive code

### Other

- docs
- readme
- codegen internal docs

## [0.1.3]https://github.com/ngergs/optionable/compare/optionable_codegen-v0.1.2...optionable_codegen-v0.1.3 - 2025-10-01

### Fixed

- handle multiple `optionable_attr` attributes

## [0.1.2]https://github.com/ngergs/optionable/compare/optionable_codegen-v0.1.1...optionable_codegen-v0.1.2 - 2025-10-01

### Fixed

- support attribute forwarding also for enum variants

## [0.1.1]https://github.com/ngergs/optionable/compare/optionable_codegen-v0.1.0...optionable_codegen-v0.1.1 - 2025-10-01

### Added

- support forwarding of helper attributes to derived optioned types

### Other

- docs

## [0.1.0]https://github.com/ngergs/optionable/releases/tag/optionable_codegen-v0.1.0 - 2025-09-30

### Added

- default-enabled feature for derive re-export
- codegen option to add derives for generated types
- codegen add public function for attributes
- codegen option for --no-convert
- rename codegen crate, use DeriveInput as input arg

### Fixed

- simplify codegen feature config logic
- codegen for nested directories
- use clap for codegen arg parsing
- osString handling for codegen output

### Other

- docs
- codegen tests
- adjust codegen version
- readme