Corrects OpenAPI annotations for artifact, config-file and asset-version endpoints#1869
Merged
Corrects OpenAPI annotations for artifact, config-file and asset-version endpoints#1869
Conversation
…ion endpoints Signed-off-by: Sebastian Kawelke <sebastian.kawelke@l3montree.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the API documentation (Swagger/OpenAPI) and controller annotations to better reflect the actual routing and payload formats for config-file, artifact SBOM/VEX, and asset-version endpoints.
Changes:
- Aligns several documented routes to include trailing slashes (to match Echo router registrations).
- Documents config-file endpoints as
text/plainwith clearer response descriptions, and adds missing project/asset config-file paths to Swagger. - Fixes the asset-version list response schema shape in Swagger (array items definition).
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/swagger.yaml | Updates/extends OpenAPI paths and response content types for config-files, asset-version refs, and artifact SBOM/VEX endpoints. |
| docs/swagger.json | JSON equivalent of the Swagger spec updates (paths, schemas, content types). |
| controllers/project_controller.go | Adds Swagger annotations for project config-file GET/PUT endpoints. |
| controllers/org_controller.go | Corrects Swagger annotations for org config-file GET/PUT (trailing slash + text/plain). |
| controllers/asset_version_controller.go | Adjusts Swagger @Router paths and list response schema annotation for asset versions. |
| controllers/asset_controller.go | Adds Swagger annotations for asset config-file GET/PUT endpoints. |
| controllers/artifact_controller.go | Refines Swagger annotations for SBOM/VEX/OpenVEX and sets XML content-type headers. |
Comments suppressed due to low confidence (1)
controllers/artifact_controller.go:559
OpenVEXJSONwrites a JSON document to the response writer, but (1) the swagger annotation documents it as{string}even though the response is JSON object data, and (2) the handler does not setContent-Type: application/json(unlikeSBOMJSON/VEXJSON). Update the annotation to an object schema and set the response content-type before writing to ensure the implementation matches@Produce application/json.
// @Param artifactName path string true "Artifact name"
// @Produce application/json
// @Success 200 {string} string "OpenVEX document in JSON format"
// @Router /organizations/{organization}/projects/{projectSlug}/assets/{assetSlug}/refs/{assetVersionSlug}/artifacts/{artifactName}/openvex.json/ [get]
func (c *ArtifactController) OpenVEXJSON(ctx shared.Context) error {
vex, err := c.buildOpenVeX(ctx)
if err != nil {
return err
}
return vex.ToJSON(ctx.Response().Writer)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ontent types Signed-off-by: Sebastian Kawelke <sebastian.kawelke@l3montree.com>
timbastin
approved these changes
Apr 10, 2026
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.
No description provided.