Skip to content

Include Go comments in JSON schemas #4966

Description

@scop

Feature Overview

Aqua has nice Go comments for its structs, but they do not make it into JSON schemas, leaving the schemas pretty much undocumented. Making use of them when generating schemas would be good.

Why is the feature needed?

Better documentation in JSON schemas.

Example Code

No response

Note

Seems this would be doable with https://github.com/invopop/jsonschema#using-go-comments, requires changes to https://github.com/suzuki-shunsuke/gen-go-jsonschema -- support for passing package to path mappings (likely multiple, so maybe a map argument?), and making aqua pass them.

More info at https://pkg.go.dev/github.com/invopop/jsonschema#Reflector.AddGoComments.

The only current use of jsonschema description in pkg/config/registry/github_cli.go could likely be removed after this.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions