Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateSchema ¶
GenerateSchema creates an OpenAPI document that represents the provided Thema Schema as an OpenAPI schema component.
Returns the result as a CUE AST, which is suitable for direct manipulation and marshaling to either JSON or YAML.
Types ¶
type Config ¶
type Config struct { *openapi.Config // Group indicates that the [thema.Schema] is from a grouped lineage - the root // schema itself does not represent an object that is ever expected to exist // independently, but each of its top-level fields do, including definitions and // optional fields. // // NOTE - https://github.com/grafana/thema/issues/62 is the issue for formalizing // the group concept. Fixing that issue will obviate this field. Once fixed, // this field will be deprecated and ignored. Group bool // RootName specifies the name to use for the type representing the root of the // schema. If empty, this defaults to titlecasing of the lineage name. // // No-op if [Group] is true. RootName string // Subpath specifies a path within the provided [thema.Schema] that should be // translated, rather than the root schema. // // No-op if [Group] is true. Subpath cue.Path // SplitSchema generates the schemas from schema and _join values, and it merges them // to generate the file. It's useful when their merged _#schema version doesn't show // the desired results. SplitSchema bool }
Config controls OpenAPI derivation from a Thema schema.
Click to show internal directories.
Click to hide internal directories.