Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix swagger spec enum #572

Merged
merged 2 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ docker-push: $(addsuffix -push,$(IMAGES))
HAS_SWAGGER := $(shell command -v swagger;)
HAS_STATICCHECK := $(shell command -v staticcheck;)
HAS_GOLANGCI_LINT := $(shell command -v golangci-lint;)
HAS_MOCKGEN := $(shell command -v golangci-lint;)
HAS_MOCKGEN := $(shell command -v mockgen;)

bootstrap:
ifndef HAS_SWAGGER
go install github.com/go-swagger/go-swagger/cmd/swagger@v0.30.5
endif
ifndef HAS_GOLANGCI_LINT
go install github.com/golangci/golangci-lint/cmd/golangci-lint@1.55.2
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55.2
endif
ifndef HAS_STATICCHECK
go install honnef.co/go/tools/cmd/staticcheck@v0.4.6
Expand Down
2 changes: 1 addition & 1 deletion api/secrets/models/secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ type Secret struct {
// Type of the secret
//
// required: false
// enum: generic,client-cert,azure-blob-fuse-volume,csi-azure-blob-volume,csi-azure-key-vault-creds,csi-azure-key-vault-item,client-cert-auth,oauth2-proxy
// example: client-cert
Type SecretType `json:"type,omitempty"`

Expand Down Expand Up @@ -64,6 +63,7 @@ type Secret struct {
TLSCertificates []TLSCertificate `json:"tlsCertificates,omitempty"`
}

// swagger:enum SecretType
type SecretType string

const (
Expand Down
1 change: 0 additions & 1 deletion api/secrets/models/secret_parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ type SecretParameters struct {
// Type of the secret
//
// required: false
// enum: generic,client-cert,azure-blob-fuse-volume,csi-azure-blob-volume,csi-azure-key-vault-creds,csi-azure-key-vault-item,client-cert-auth,oauth2-proxy
// example: azure-blob-fuse-volume
Type SecretType `json:"type,omitempty"`
}
36 changes: 30 additions & 6 deletions swaggerui/html/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -7180,7 +7180,21 @@
"x-go-name": "TLSCertificates"
},
"type": {
"$ref": "#/definitions/SecretType"
"description": "Type of the secret\ngeneric SecretTypeGeneric\nclient-cert SecretTypeClientCert\nazure-blob-fuse-volume SecretTypeAzureBlobFuseVolume\ncsi-azure-blob-volume SecretTypeCsiAzureBlobVolume\ncsi-azure-key-vault-creds SecretTypeCsiAzureKeyVaultCreds\ncsi-azure-key-vault-item SecretTypeCsiAzureKeyVaultItem\nclient-cert-auth SecretTypeClientCertificateAuth\noauth2-proxy SecretTypeOAuth2Proxy",
"type": "string",
"enum": [
"generic",
"client-cert",
"azure-blob-fuse-volume",
"csi-azure-blob-volume",
"csi-azure-key-vault-creds",
"csi-azure-key-vault-item",
"client-cert-auth",
"oauth2-proxy"
],
"x-go-enum-desc": "generic SecretTypeGeneric\nclient-cert SecretTypeClientCert\nazure-blob-fuse-volume SecretTypeAzureBlobFuseVolume\ncsi-azure-blob-volume SecretTypeCsiAzureBlobVolume\ncsi-azure-key-vault-creds SecretTypeCsiAzureKeyVaultCreds\ncsi-azure-key-vault-item SecretTypeCsiAzureKeyVaultItem\nclient-cert-auth SecretTypeClientCertificateAuth\noauth2-proxy SecretTypeOAuth2Proxy",
"x-go-name": "Type",
"example": "client-cert"
}
},
"x-go-package": "github.com/equinor/radix-api/api/secrets/models"
Expand All @@ -7199,15 +7213,25 @@
"example": "p4$sW0rDz"
},
"type": {
"$ref": "#/definitions/SecretType"
"description": "Type of the secret\ngeneric SecretTypeGeneric\nclient-cert SecretTypeClientCert\nazure-blob-fuse-volume SecretTypeAzureBlobFuseVolume\ncsi-azure-blob-volume SecretTypeCsiAzureBlobVolume\ncsi-azure-key-vault-creds SecretTypeCsiAzureKeyVaultCreds\ncsi-azure-key-vault-item SecretTypeCsiAzureKeyVaultItem\nclient-cert-auth SecretTypeClientCertificateAuth\noauth2-proxy SecretTypeOAuth2Proxy",
"type": "string",
"enum": [
"generic",
"client-cert",
"azure-blob-fuse-volume",
"csi-azure-blob-volume",
"csi-azure-key-vault-creds",
"csi-azure-key-vault-item",
"client-cert-auth",
"oauth2-proxy"
],
"x-go-enum-desc": "generic SecretTypeGeneric\nclient-cert SecretTypeClientCert\nazure-blob-fuse-volume SecretTypeAzureBlobFuseVolume\ncsi-azure-blob-volume SecretTypeCsiAzureBlobVolume\ncsi-azure-key-vault-creds SecretTypeCsiAzureKeyVaultCreds\ncsi-azure-key-vault-item SecretTypeCsiAzureKeyVaultItem\nclient-cert-auth SecretTypeClientCertificateAuth\noauth2-proxy SecretTypeOAuth2Proxy",
"x-go-name": "Type",
"example": "azure-blob-fuse-volume"
}
},
"x-go-package": "github.com/equinor/radix-api/api/secrets/models"
},
"SecretType": {
"type": "string",
"x-go-package": "github.com/equinor/radix-api/api/secrets/models"
},
"SlackConfig": {
"description": "SlackConfig configuration options for Slack",
"type": "object",
Expand Down
Loading