Repository navigation
Conversation
|
Coverage of the acceptance run against the meshStack backend, on
Uncovered functions
|
grubmeshi
force-pushed
the
feature/openapi-spec-hal
branch
2 times, most recently
from
October 23, 2026 11:51
cdd9406 to
8a4ad52
Compare
The generator downloads the same documents as meshstack api-docs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…PI docs The derived spec refers to its responses and parameters as components and declares parameters on the path, which the reader missed. Schema now carries allOf, oneOf, discriminator, enum, nullable, readOnly, writeOnly and additionalProperties. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The generated clients leave kind and apiVersion out of their types, so Api adds them to a meshObject body and checks them on the answer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A repository configures the generator in Go, with a TypeMapper for what the spec leaves open, and selects operations by kind, action and version. A schema that only one kind and version reaches lands in that kind's package, one that several reach in a shared package. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hBuildingBlockRun v1 go generate ./client downloads the API docs of develop; -spec names another document. The TypeMapper gives a building block input value the SecretOrAny the Terraform provider converts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…client Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ated packages A run lock now counts as unfinished only while the run is IN_PROGRESS: the API docs list IN_PROGRESS, SUCCEEDED and FAILED for a run, and no PENDING. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nt/meshapi Another module's generated clients cannot import client/internal. Config.Runtime names the package for a module that brings its own, and client.Client.HttpClient is what their NewClient takes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fter their key
A generated package, type or method of a deprecated version or operation carries a
"Deprecated:" paragraph, which staticcheck reports at each use. A path parameter takes the
name of the key it holds, as Get(ctx, uuid) or Get(ctx, name), and a template key such as
{metadata.ownedByWorkspace}.{metadata.name} takes one parameter per field, which the client
joins. The packages are regenerated from the latest spec.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ife or as outdated The "Deprecated:" paragraph of a generated package, type or method reads "removed after <date>." for a version with an end of life, and "a newer version is available." otherwise. The API docs no longer carry x-deprecated-description or a "Deprecated:" description prefix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… schema A query parameter of format uuid is a uuid.UUID, and an enum is its typed string with constants: a component's own type, or one the package names after the filter and the parameter, such as ListFilterSort. Every field is omitzero, so a zero UUID stays out of the query. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The ListFilter of meshworkspace/v2, meshbuildingblock/v2 and meshbuildingblockrun/v1 takes UUIDs as uuid.UUID and enum values as typed constants, such as the sort keys a list accepts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ckRun v1 from the current spec UUID fields such as definitionUuid, latestRunUuid and the run's metadata.uuid are uuid.UUID. Building block definition version refs and building block refs lose name. The target ref is one MeshBuildingBlockTargetRef for both directions, with required name or uuid. Its kind and the run's implementation type are string, since the spec now types each variant's discriminator inline. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
grubmeshi
force-pushed
the
feature/openapi-spec-hal
branch
from
October 25, 2026 21:37
8a4ad52 to
5ac48d7
Compare
A property or query parameter the spec marks deprecated gets a Go "Deprecated:" paragraph, so staticcheck reports its use. The text is the API's "**Deprecated:**" paragraph, of the package's API version for a filter, else "see the API documentation.". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
parentBuildingBlocks, the parent refs' buildingBlockUuid and definitionUuid, status.status and the status filter are deprecated, as is authorType of meshobject.MeshObjectAuthor. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
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.



Draft for a first look. It is a prototype of a generator that writes the client's Go types and a thin typed client from meshStack's OpenAPI spec.
Why
The client's DTOs are written by hand today. meshStack now derives its OpenAPI spec from its controllers (meshcloud-internal: meshfed-release#11378), so the spec states every field, its type, whether it is required and in which direction. The generator turns that into Go, so the client follows the API without hand-written copies.
What it does
client/openapi/generatoris a library. A repository calls it from its own smallmain.gowith a Go config, which selects operations by kind, action and version and can map a schema to its own Go type (for exampletypes.SecretOrAny). The CLI's config is inclient/internal/generate, run bygo generate.client/meshworkspace/v2ispackage meshworkspace, withRequest,Responseand aClient. Types that several packages use go toclient/meshobject.Clienthas one method per action.Listreturnsiter.Seq2[T, error], andpages.ReadAllcollects it.Get(ctx, uuid uuid.UUID),Get(ctx, name string), with the key's description in the doc comment. A composite key such as{metadata.ownedByWorkspace}.{metadata.name}becomes one parameter per field (workspace, project string), and the client joins them, so a caller passes fields it already has and never builds the identifier format itself.Deprecated:paragraph from the spec's lifecycle data, as does a deprecated operation or schema. staticcheck reports each use.client/meshapi(Api,Call,Path,HttpClient), so other repositories can generate their own packages;Config.Runtimenames another runtime, andclient.Client.HttpClientis what theirNewClienttakes.client/internalkeeps the flat client's helpers.Linksfield, withHrefandExpand. Page wrappers are read by the generic pager.omitzero, so a request can sendfalsewhere the server default istrue. Slices and maps are never pointers.enum.Ofregistry. A discriminatedoneOfbecomes the discriminator field plus one pointer per variant.This PR generates
meshworkspace/v2,meshbuildingblock/v2andmeshbuildingblockrun/v1, and the workspace, building block and run commands use them. The old flatclienttypes stay, because the Terraform provider imports them.How to look at it
client/*/v*/generated.goandclient/meshobject/generated.go.client/openapi/generator/testdata.go run ./internal/generate -spec <file>inclient/.Open
tfsdktags yet; the Terraform provider still uses the flat types.🤖 Generated with Claude Code