Rename scope.name to scope.title since name exists in metadata. (#83172)

name is part of metadata which is confusing

Signed-off-by: bergquist <carl.bergquist@gmail.com>
This commit is contained in:
Carl Bergquist 2024-02-21 15:32:57 +01:00 committed by GitHub
parent 2258e6bd16
commit 028d0d0c2c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 50 additions and 4 deletions

View File

@ -391,6 +391,14 @@ func schema_pkg_apis_featuretoggle_v0alpha1_ToggleStatus(ref common.ReferenceCal
Format: "",
},
},
"stage": {
SchemaProps: spec.SchemaProps{
Description: "The feature toggle stage",
Default: "",
Type: []string{"string"},
Format: "",
},
},
"enabled": {
SchemaProps: spec.SchemaProps{
Description: "Is the flag enabled",
@ -421,7 +429,7 @@ func schema_pkg_apis_featuretoggle_v0alpha1_ToggleStatus(ref common.ReferenceCal
},
},
},
Required: []string{"name", "enabled", "writeable"},
Required: []string{"name", "stage", "enabled", "writeable"},
},
},
Dependencies: []string{

View File

@ -28,6 +28,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA
"github.com/grafana/grafana/pkg/apis/query/v0alpha1/template.Target": schema_apis_query_v0alpha1_template_Target(ref),
"github.com/grafana/grafana/pkg/apis/query/v0alpha1/template.TemplateVariable": schema_apis_query_v0alpha1_template_TemplateVariable(ref),
"github.com/grafana/grafana/pkg/apis/query/v0alpha1/template.VariableReplacement": schema_apis_query_v0alpha1_template_VariableReplacement(ref),
"github.com/grafana/grafana/pkg/apis/query/v0alpha1/template.replacement": schema_apis_query_v0alpha1_template_replacement(ref),
}
}
@ -584,3 +585,37 @@ func schema_apis_query_v0alpha1_template_VariableReplacement(ref common.Referenc
"github.com/grafana/grafana/pkg/apis/query/v0alpha1/template.Position"},
}
}
func schema_apis_query_v0alpha1_template_replacement(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Type: []string{"object"},
Properties: map[string]spec.Schema{
"Position": {
SchemaProps: spec.SchemaProps{
Ref: ref("github.com/grafana/grafana/pkg/apis/query/v0alpha1/template.Position"),
},
},
"TemplateVariable": {
SchemaProps: spec.SchemaProps{
Ref: ref("github.com/grafana/grafana/pkg/apis/query/v0alpha1/template.TemplateVariable"),
},
},
"format": {
SchemaProps: spec.SchemaProps{
Description: "Possible enum values:\n - `\"csv\"` Formats variables with multiple values as a comma-separated string.\n - `\"doublequote\"` Formats single- and multi-valued variables into a comma-separated string\n - `\"json\"` Formats variables with multiple values as a comma-separated string.\n - `\"pipe\"` Formats variables with multiple values into a pipe-separated string.\n - `\"raw\"` Formats variables with multiple values into comma-separated string. This is the default behavior when no format is specified\n - `\"singlequote\"` Formats single- and multi-valued variables into a comma-separated string",
Default: "",
Type: []string{"string"},
Format: "",
Enum: []interface{}{"csv", "doublequote", "json", "pipe", "raw", "singlequote"},
},
},
},
Required: []string{"Position", "TemplateVariable", "format"},
},
},
Dependencies: []string{
"github.com/grafana/grafana/pkg/apis/query/v0alpha1/template.Position", "github.com/grafana/grafana/pkg/apis/query/v0alpha1/template.TemplateVariable"},
}
}

View File

@ -4,3 +4,6 @@ API rule violation: names_match,github.com/grafana/grafana/pkg/apis/query/v0alph
API rule violation: names_match,github.com/grafana/grafana/pkg/apis/query/v0alpha1,GenericDataQuery,RefID
API rule violation: names_match,github.com/grafana/grafana/pkg/apis/query/v0alpha1,QueryDataResponse,QueryDataResponse
API rule violation: names_match,github.com/grafana/grafana/pkg/apis/query/v0alpha1/template,QueryTemplate,Variables
API rule violation: names_match,github.com/grafana/grafana/pkg/apis/query/v0alpha1/template,replacement,Position
API rule violation: names_match,github.com/grafana/grafana/pkg/apis/query/v0alpha1/template,replacement,TemplateVariable
API rule violation: names_match,github.com/grafana/grafana/pkg/apis/query/v0alpha1/template,replacement,format

View File

@ -13,7 +13,7 @@ type Scope struct {
}
type ScopeSpec struct {
Name string `json:"name"`
Title string `json:"title"`
Type string `json:"type"`
Description string `json:"description"`
Category string `json:"category"`

View File

@ -178,7 +178,7 @@ func schema_pkg_apis_scope_v0alpha1_ScopeSpec(ref common.ReferenceCallback) comm
SchemaProps: spec.SchemaProps{
Type: []string{"object"},
Properties: map[string]spec.Schema{
"name": {
"title": {
SchemaProps: spec.SchemaProps{
Default: "",
Type: []string{"string"},
@ -220,7 +220,7 @@ func schema_pkg_apis_scope_v0alpha1_ScopeSpec(ref common.ReferenceCallback) comm
},
},
},
Required: []string{"name", "type", "description", "category", "filters"},
Required: []string{"title", "type", "description", "category", "filters"},
},
},
Dependencies: []string{