Skip to content

docs: codegen output and packaging-layer design specs - #136

Draft
OmarAlJarrah wants to merge 1 commit into
mainfrom
docs/codegen-output-conventions-design
Draft

docs: codegen output and packaging-layer design specs#136
OmarAlJarrah wants to merge 1 commit into
mainfrom
docs/codegen-output-conventions-design

Conversation

@OmarAlJarrah

Copy link
Copy Markdown
Member

Summary

Adds design specifications for the output and packaging layer of a future code generator that
will emit per-API SDKs on top of the hand-written sdk-core toolkit. These are design docs only
under docs/codegen/ — no generator, KotlinPoet, or schema/validation code is introduced, and
nothing here ships in sdk-core. Every code-shaped snippet is labelled as illustrative target
generator output, not compiled in this repo.

Each spec is grounded in the real sdk-core API (Serde, Tristate, RequestBody, Paginator,
the HttpClient / AsyncHttpClient SPIs, HttpPipeline / HttpPipelineBuilder, the Io seam, and
the context chain) so the eventual generator targets the current surface.

Docs added

  • strict-structured-output-schema.md — strict JSON-schema encoding rules for structured
    outputs: all-required, additionalProperties:false, optional-as-nullable-union, deterministic
    $defs names, and how Tristate collapses to value | null on the wire. Derivation and the
    hand-rolled subset validator live in a Jackson adapter, never sdk-core.
  • fail-soft-validator-skeleton.md — design of a reusable fail-soft recursive validator
    (one-shot recursion guard, path-prefixed error list, early-return verify helper, deterministic
    definition names). Deferred: design only, no runtime type added today.
  • generated-sdk-provenance.md — a provenance file (generator version + normalized
    input-contract hash, plus supporting metadata), its JSON format, and its classpath + source-root
    locations. Stamped into generated output only, never the toolkit.
  • spring-boot-starter.md — per-API Spring Boot starter shape: a @ConfigurationProperties
    class, a fun interface customizer, and an @AutoConfiguration with @Bean @ConditionalOnMissingBean
    that assembles {IoProvider + transport + HttpPipeline}. Spring deps confined to the generated
    starter module.
  • README.md — index linking the four specs and listing the sdk-core anchors they build on.

Notes

Docs only — no source, build, or public-API changes.

Closes #66
Closes #67
Closes #68
Closes #69

Capture the design for the generator's output and packaging layer as
spec docs under docs/codegen/, grounded in the existing sdk-core API.
No generator or KotlinPoet code is added; these are design specs only.

- strict-structured-output-schema.md: strict JSON-schema encoding rules
  (all-required + additionalProperties:false + optional-as-nullable-union),
  with the Tristate collapse and adapter-only derivation.
- fail-soft-validator-skeleton.md: design of a reusable fail-soft
  recursive validator (recursion guard, path-prefixed errors,
  deterministic definition names). Deferred until codegen exists.
- generated-sdk-provenance.md: provenance file (generator version +
  input-contract hash), format and location, generated output only.
- spring-boot-starter.md: per-API Spring Boot starter shape
  (@ConfigurationProperties, fun interface customizer, @autoConfiguration
  assembling IoProvider + transport + HttpPipeline), Spring confined to
  the generated starter module.
- README.md: index linking the specs.
@OmarAlJarrah
OmarAlJarrah marked this pull request as draft June 17, 2026 01:52
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.

Emit a Spring Boot starter per generated API Stamp a provenance file into generated SDKs Provide a reusable fail-soft recursive validator skeleton for generator output Capture strict structured-output JSON-schema encoding rules

1 participant