API Documentation
According to actual business needs, we generally divide APIs into three types: standard K8S API, advanced API, and CRD (Custom Resource Definition). Therefore, the directory structure is usually organized as follows:
K8S API
Standard K8S API
Refer to DaemonSet.
CRD
Refer to ArtifactCleanupRun.
props
name: Reference name under OpenAPI schemadefinitions(v2) orcomponents/schemas(v3), or CRDmetadata.namenamespaced: Indicates whether the resource is namespace-scoped, i.e. whether the API Endpoints include the namespace path parameternamespaces/{namespace}. A CRD'sspec.scopedecides it when this is unset; OpenAPI sources do not carry a scope and default totruepathPrefix: Can be used to override the global configurationapi.pathPrefixfilepath: Similar to specifying openapi path, used to specify a particular openapi or CRD fileapiGroup: Optional, specifies the API group; openapi will try to read the referencedx-kubernetes-group-version-kind, same belowapiVersion: Optional, specifies the API version; a CRD defaults to the versionkubectlresolves to — the highest-priorityservedversion — whichapi.crdVersioncan changeapiKind: Optional, specifies the API resource kindplural: Optional, the resource's plural name used in the endpoint paths. A CRD'sspec.names.pluralis read automatically; set this for OpenAPI sources whose plural is irregular, otherwise it is derived from the kindhasStatus: Optional, whether the API server exposes astatussubresource. A CRD'ssubresources.statusdecides it; for an OpenAPI source the routes listed in the document decide it. This prop overrides both
An OpenAPI document that carries no x-kubernetes-group-version-kind — aggregation-layer documents routinely omit it — must have apiVersion and apiKind declared here, plus apiGroup outside the core group. Otherwise the group, version and kind cannot be derived: the API Endpoints section is omitted rather than built from empty path segments, and doom lint reports the page.
Advanced API
Refer to CodeQualityTaskSummary.
props
path: Path under OpenAPI schemapathspathPrefix: Can be used to override the global configurationapi.pathPrefixopenapiPath: See specifying openapi path
Common References
Refer to CodeQuality.
props
schema: Reference name under OpenAPI schemadefinitions(v2) orcomponents/schemas(v3)openapiPath: See specifying openapi path
Specifying openapi Path
For OpenAPIPath and OpenAPIRef components, by default, the system searches through all openapi definition files until a match is found. If you need to specify a particular openapi file, you can use the openapiPath property: