mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #53] [CLOSED] feat(api): render server OpenAPI from tag-based templates #142
Labels
No labels
bug
documentation
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/AgentENV#142
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/kvcache-ai/AgentENV/pull/53
Author: @fy2462
Created: 7/28/2026
Status: ❌ Closed
Base:
main← Head:main📝 Commits (4)
aba229dfeat: render server OpenAPI from templates5b8acb1chore: remove OpenAPI codegen tests748e2c1fix(api): validate spec fragments and field naming5e56dadMerge remote-tracking branch 'upstream/main'📊 Changes
19 files changed (+3956 additions, -1437 deletions)
View changed files
📝
Cargo.lock(+10 -0)📝
adev/Cargo.toml(+1 -0)📝
adev/src/codegen.rs(+178 -1)📝
src/api/generated/src/models.rs(+3 -3)📝
src/api/openapi.yml(+1433 -1433)➕
src/api/spec/README.md(+80 -0)➕
src/api/spec/components/parameters.yml(+75 -0)➕
src/api/spec/components/responses.yml(+37 -0)➕
src/api/spec/components/schemas/admin.yml(+229 -0)➕
src/api/spec/components/schemas/common.yml(+35 -0)➕
src/api/spec/components/schemas/sandboxes.yml(+471 -0)➕
src/api/spec/components/schemas/snapshots.yml(+47 -0)➕
src/api/spec/components/schemas/templates.yml(+343 -0)➕
src/api/spec/components/security.yml(+25 -0)➕
src/api/spec/openapi.tmpl(+39 -0)➕
src/api/spec/paths/admin.yml(+59 -0)➕
src/api/spec/paths/sandboxes.yml(+561 -0)➕
src/api/spec/paths/snapshots.yml(+74 -0)➕
src/api/spec/paths/templates.yml(+256 -0)📄 Description
Summary
Split the monolithic server OpenAPI specification into a template and tag-based YAML fragments under
src/api/spec/.cargo adev codegen servernow performs the complete workflow:src/api/openapi.ymlfrom the template and fragments.src/api/generated.The rendered
src/api/openapi.ymlremains committed to the repository. This keeps it available to documentation and other tooling while making the source specification easier to maintain.Closes #52
Changes
src/api/spec/openapi.tmplfor the top-level OpenAPI document.admin.ymltemplates.ymlsandboxes.ymlsnapshots.ymlcomponents/schemas/common.yml.component files.
adev/src/codegen.rs.uponas the lightweight template rendering dependency.src/api/openapi.yml.src/api/spec/README.mddescribing the rendering rules and API extensionworkflow.
Rendering behavior
The renderer reads tag order from the top-level
tagssection inopenapi.tmpl.The generated document is assembled in the following order:
openapi.tmpl.components/schemas/common.yml.The position of the
tagssection within the template does not affectrendering. Only the order of its entries controls schema and path ordering.
A tag may omit either its schema file or path file. However, a fragment whose
filename does not match a declared tag is rejected to prevent API definitions
from being silently omitted.
Adding an API
For an endpoint under an existing tag:
paths/<tag>.yml.components/schemas/<tag>.yml.components/schemas/common.yml.cargo adev codegen server.For a new API category:
openapi.tmplin the desired order.paths/<tag>.yml.components/schemas/<tag>.ymlwhen needed.cargo adev codegen server.Compatibility
This change reorganizes the source OpenAPI specification without changing its API semantics.
After regeneration,
src/api/generatedremains unchanged.No GitHub workflow or documentation build changes are required because the rendered
src/api/openapi.ymlremains committed.Validation
src/api/openapi.ymlis rendered with the expected formattingcargo adev codegen servergit diff --checksrc/api/generatedhas no changes🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.