Repository navigation
feat: an opt-in setting of AddTypeKit writes every value object in place - #136
Merged
CaffeinatedCoder merged 1 commit intoOct 29, 2026
Merged
Conversation
AddTypeKit(typeKit => typeKit.InlineValueObjects = true) gives no value object a component: the reference-id wrapper answers null for a value object, or its Nullable<T>, before the host's delegate, so every position takes the inline path. Closed sets and wrapped enums keep their components and their claims (decision 55); without the setting the document is unchanged. Decision 115 records it. SchemaTests runs under both settings in 3.1, 3.0 and 2.0, inlined over the nullable properties and the containers too, with controls added for the ones that had none, and is registered as an oracle with the seed inline-value-objects-ignored. NullablePositionTests' inline-value-objects mode is now the setting. The variant class is where value objects are described (components, the setting, a host's own null) by the version; a described type's parameter under the setting is listed in axes.md as a pair no test varies yet. Co-Authored-By: Claude Opus 5.5 <[email protected]>
CaffeinatedCoder
added a commit
that referenced
this pull request
Oct 29, 2026
#136 took decision 0115, so the docs site's record is renumbered to 0116: the file, its heading, its index row and every link to it. Both changelog lines and both index rows kept. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #83
Problem
With
AddTypeKit(), a value object in a body keeps a component named after it. Some clients do better with plain types: a generator that makes a class per component gives aCustomerIdwrapper where the application wanted astring, and under OpenAPI 2.0 a nullable property of a component loses its type (KB-026). Inlining took a host's ownCreateSchemaReferenceIdset afterAddTypeKit(), reflecting over aCompilerServicesattribute, which also replaced TypeKit's naming and decision 55's check for closed sets.Change
AddTypeKit(typeKit => typeKit.InlineValueObjects = true): a new overload takingAction<TypeKitOpenApiOptions>(new public class, one property, off by default).AddTypeKit()now calls it with no setting.ValueObjectSchemaReferenceIds: with the setting, a value object or itsNullable<T>getsnullbefore the host's delegate is asked, so every position takes the existing inline path. Closed sets and wrapped enums keep their components and their claims.design/adr/0115-value-objects-can-be-inlined-everywhere.md, index row,design/openapi.md): the setting, why value objects only, and how it sits with decisions 55 (an inlined value object claims no name; closed sets still refused) and 106 (nothing left to decide: no component is shared between JSON positions and parameters).docs/aspnet-core.md"Describe value objects as plain types" with a compiled sample and a test that holds the JSON it shows; the package README's predicate gives way to the setting (its sample region removed); changelog line under 2.3.0.C27-*),SchemaTestsregistered as a differential oracle with the seedinline-value-objects-ignored.patch,axes.mdrow for where value objects are described.Tests
SchemaTestsruns under both settings in OpenAPI 3.1, 3.0 and 2.0; inlined, also over the nullable properties, the containers and nested containers, whose controls were added toControlDocument, and a dictionary keyed by a value object (CountsById, both settings).OpenApiJson.Componentsreads 2.0'sdefinitions.NullablePositionTests'inline-value-objectsmode is the setting: every position (body, query, header, form, route, response, elements, values, query/header items, polymorphic) × 3.1/3.0/2.0 × enums by number/name × MVC/minimal.InlineValueObjectsSettingTests: no value-object component in any version (with the default document as control), the default document byte for byte with no setting and with the setting off, a later plainAddTypeKit()keeps them inlined, the host's names for other types, decision 55's claims, a null configuration.oracles seeds inline-value-objects-ignored→ CAUGHT, 92 of 164. The setting on by default → 70 of 174 fail (every component row and the default-document test).🤖 Generated with Claude Code