• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kcl-lang / kcl-openapi
67%

Build:
DEFAULT BRANCH: main
Repo Added 04 Jul 2023 07:31AM UTC
Token bsczfAPhgbOT0k4RAgkHGpQ11pAGLDtoO regen
Build 262 Last
Files 21
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

LAST BUILD ON BRANCH main
branch: SELECT
CHANGE BRANCH
x
Sync Branches
  • No branch selected
  • add-map-to-kcl-value
  • amyXia1994-patch-1
  • bugfix-143-multiple-validations
  • bump/cla
  • chore-bump-regex-match-func
  • chore-deprecated-cli
  • chore-update-cla-version
  • chore/docker-release-config
  • chore/migrate-repo
  • chore/update-release-ci
  • ci-update-test-condition
  • cleanup_ioutil
  • dependabot/github_actions/actions/checkout-4
  • dependabot/github_actions/actions/checkout-5
  • dependabot/github_actions/actions/checkout-6
  • dependabot/github_actions/actions/checkout-7
  • dependabot/github_actions/actions/setup-go-5
  • dependabot/github_actions/actions/setup-go-6
  • dependabot/github_actions/actions/setup-go-7
  • dependabot/github_actions/actions/setup-python-5
  • dependabot/github_actions/actions/setup-python-6
  • dependabot/github_actions/actions/setup-python-7
  • dependabot/github_actions/docker/login-action-3
  • dependabot/github_actions/goreleaser/goreleaser-action-6
  • dependabot/go_modules/github.com/go-openapi/errors-0.22.0
  • dependabot/go_modules/github.com/go-openapi/errors-0.22.1
  • dependabot/go_modules/github.com/go-openapi/errors-0.22.2
  • dependabot/go_modules/github.com/go-openapi/errors-0.22.3
  • dependabot/go_modules/github.com/go-openapi/inflect-0.21.0
  • dependabot/go_modules/github.com/go-openapi/inflect-0.21.2
  • dependabot/go_modules/github.com/go-openapi/inflect-0.21.3
  • dependabot/go_modules/github.com/go-openapi/inflect-1.0.0
  • dependabot/go_modules/github.com/go-openapi/loads-0.25.2
  • dependabot/go_modules/github.com/go-openapi/strfmt-0.23.0
  • dependabot/go_modules/github.com/go-openapi/strfmt-0.24.0
  • dependabot/go_modules/github.com/go-openapi/strfmt-0.27.0
  • dependabot/go_modules/github.com/jessevdk/go-flags-1.6.1
  • dependabot/go_modules/github.com/kr/pretty-0.3.1
  • dependabot/go_modules/github.com/stretchr/testify-1.10.0
  • dependabot/go_modules/github.com/stretchr/testify-1.11.0
  • dependabot/go_modules/github.com/stretchr/testify-1.11.1
  • dependabot/go_modules/github.com/stretchr/testify-1.12.1
  • dependabot/go_modules/github.com/stretchr/testify-1.9.0
  • doc/contributing
  • doc/install-approaches
  • doc/k8s-pkg-generate
  • enhance-int-or-string-array-pattern
  • enhance/support-v1-crd-versions
  • feat-item-all-pattern
  • feat-mangle-property-name-with-quote
  • feat-protocol-mixin-suffix
  • feat-use-raw-string-for-generated-schema
  • feat-yaml-stream-format-input
  • feat/18-reuse-existing-models
  • feat/22-cel-validations
  • feat/35-openapi3-support-v2
  • feat/53-package-root
  • feat/preprocess-script
  • fix
  • fix-additional-property-pattern
  • fix-all-of-pattern
  • fix-default-value-with-x-order-generation
  • fix-disable-auto-block-pr-option
  • fix-multiple-pattern-in-items-and-additional-properties
  • fix-nil-pointer-for-array-branch
  • fix-optional-attr-min-and-max-validation-gen
  • fix-schema-generation
  • fix-split-documents
  • fix-typo-in-documents
  • fix-yaml-stream-format-input
  • fix/147-comment-only-doc-skip
  • fix/151-list-pattern-regex
  • fix/179-crd-short-schema-names
  • fix/181-crd-single-version-names
  • fix/cel-kcl-valid-output
  • fix/conflict-import
  • fix/docker-username-pw
  • fix/empty-check-blocks
  • fix/govulncheck-2026-08
  • fix/import-path-under-pkgroot
  • fix/issue-165-kin-openapi-bump
  • fix/mixin_protocol_suffix
  • fix/multiline-default-string
  • fix/multiple-version-crdext-v1
  • fix/pre-process
  • fix/regex-check
  • fix/wrong-crd-apiversion
  • fix_link
  • main
  • mangle-system-module-import
  • minor/add-version
  • refs/tags/v0.5.0
  • refs/tags/v0.5.1
  • refs/tags/v0.5.2
  • refs/tags/v0.5.3
  • refs/tags/v0.5.4
  • refs/tags/v0.5.5
  • refs/tags/v0.6.0
  • refs/tags/v0.6.1
  • refs/tags/v0.6.2
  • refs/tags/v0.6.3
  • refs/tags/v0.6.4
  • refs/tags/v0.6.5
  • refs/tags/v0.6.6
  • refs/tags/v0.7.0
  • refs/tags/v0.8.0
  • refs/tags/v0.9.0
  • support-int-or-str
  • workflow/sync-k8s-models

09 Oct 2026 04:44PM UTC coverage: 66.742% (+2.0%) from 64.723%
37961329110

push

github

web-flow
fix(generator): keep version in CRD schema names and merge multi-document CRDs into one spec (#182)

* fix(generator): keep version in CRD schema names and merge multi-document CRDs into one spec

Fixes #181. Since #180, importing a CRD with exactly one version produced
schema names after the bare Kind (e.g. Widget), dropping the version
qualifier. Two defects, one root cause:

A. kcl import groups the generated files into per-version directories by
   extracting the version from the file name (_v1, _v1alpha1, ...). A
   single-version CRD rendered as models/unknown/widget.k instead of
   models/v1/example_com_v1_widget.k, silently changing the import path
   of published modules (e.g. strimzi_kafka_operator.v1 -> ...unknown).

B. Two CRDs sharing a Kind across different API groups both rendered as
   models/widget.k: the CLI converts each YAML document of the input file
   into its own spec and generates each separately, so the second file
   silently overwrote the first with exit code 0.

Fixes:

- pkg/swagger/generator/names.go: append the version to the short root
  name unconditionally (Widget -> WidgetV1), so the file name always
  carries the version. When the same Kind+Version is declared by several
  API groups, every root of that class is additionally qualified with its
  group segments (example.com/other.com Widget -> ExampleComWidgetV1 /
  OtherComWidgetV1), keeping both definitions and preserving the group
  identity #180 removed.
- pkg/kube_resource/generator/generator.go: GetSpecs/GetSpec now merge
  all YAML documents of one file into a single swagger spec, so every CRD
  of the file is generated in one run against a shared name registry
  instead of one overwrite-prone generation per document. As a side
  effect the standalone binary handles multi-document files too instead
  of silently converting only the first document.
- pkg/swagger/generator/{model,language}.go: make the rendered default
  and example values deterministic. Recove... (continued)

79 of 97 new or added lines in 5 files covered. (81.44%)

1 existing line in 1 file now uncovered.

3267 of 4895 relevant lines covered (66.74%)

0.76 hits per line

Relevant lines Covered
Build:
Build:
4895 RELEVANT LINES 3267 COVERED LINES
0.76 HITS PER LINE
Source Files on main
  • Tree
  • List 21
  • Changed 5
  • Source Changed 0
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
37961329110 main fix(generator): keep version in CRD schema names and merge multi-document CRDs into one spec (#182) * fix(generator): keep version in CRD schema names and merge multi-document CRDs into one spec Fixes #181. Since #180, importing a CRD with exact... push 09 Oct 2026 04:49PM UTC web-flow github
66.74
37960217708 fix/181-crd-single-version-names fix(generator): close temp spec files so Windows can clean them up WithXOrder and getSpecFiles created their temp files with os.CreateTemp but never closed the returned handle (the content was written through a second handle, or written but left ... Pull #182 09 Oct 2026 04:39PM UTC claude github
66.74
37959362170 fix/181-crd-single-version-names fix(generator): keep x-order rewrite next to the spec and clean it up WithXOrder wrote the rewritten spec to the temp dir root, away from the original document. Relative $refs in the spec (e.g. the k8s.json sidecar written next to converted CRD s... Pull #182 09 Oct 2026 04:32PM UTC claude github
66.73
35564743446 main feat(generator): short, organized schema names for CRD imports (#180) Fixes #179. Importing a CRD used to produce schema names glued from the full property path, e.g. ArgoprojIoV1alpha1ClusterWorkflowTemplateSpecAffinityNodeAffinity... PreferredD... push 21 Sep 2026 05:34AM UTC web-flow github
64.72
35564453053 fix/179-crd-short-schema-names feat(generator): short, organized schema names for CRD imports Fixes #179. Importing a CRD used to produce schema names glued from the full property path, e.g. ArgoprojIoV1alpha1ClusterWorkflowTemplateSpecAffinityNodeAffinity... PreferredDuringSc... Pull #180 21 Sep 2026 05:27AM UTC claude github
64.72
34169862597 dependabot/go_modules/github.com/go-openapi/inflect-1.0.0 Chore: (deps): bump github.com/go-openapi/inflect from 0.21.3 to 1.0.0 Bumps [github.com/go-openapi/inflect](https://github.com/go-openapi/inflect) from 0.21.3 to 1.0.0. - [Release notes](https://github.com/go-openapi/inflect/releases) - [Commits... Pull #174 07 Sep 2026 11:25PM UTC web-flow github
64.29
33465196655 main Chore: (deps): bump github.com/stretchr/testify from 1.11.1 to 1.12.1 (#170) Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.11.1 to 1.12.1. - [Release notes](https://github.com/stretchr/testify/releases) - [Commit... push 01 Sep 2026 03:12AM UTC web-flow github
64.29
33462367124 dependabot/go_modules/github.com/stretchr/testify-1.12.1 Chore: (deps): bump github.com/stretchr/testify from 1.11.1 to 1.12.1 Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.11.1 to 1.12.1. - [Release notes](https://github.com/stretchr/testify/releases) - [Commits](http... Pull #170 01 Sep 2026 02:26AM UTC web-flow github
64.29
33462022557 dependabot/go_modules/github.com/go-openapi/loads-0.25.2 Chore: (deps): bump github.com/go-openapi/loads from 0.21.1 to 0.25.2 Bumps [github.com/go-openapi/loads](https://github.com/go-openapi/loads) from 0.21.1 to 0.25.2. - [Release notes](https://github.com/go-openapi/loads/releases) - [Commits](http... Pull #169 01 Sep 2026 02:19AM UTC web-flow github
64.29
33461894309 main Chore: (deps): bump github.com/go-openapi/strfmt from 0.24.0 to 0.27.0 (#172) Bumps [github.com/go-openapi/strfmt](https://github.com/go-openapi/strfmt) from 0.24.0 to 0.27.0. - [Release notes](https://github.com/go-openapi/strfmt/releases) - [Co... push 01 Sep 2026 02:17AM UTC web-flow github
64.29
See All Builds (256)

Badge your Repo: kcl-openapi

We detected this repo isn’t badged! Grab the embed code to the right, add it to your repo to show off your code coverage, and when the badge is live hit the refresh button to remove this message.

Could not find badge in README.

Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

Refresh
  • Settings
  • Repo on GitHub
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc