Skip to content

Commit

Permalink
fix: move constants to constants
Browse files Browse the repository at this point in the history
helps with better namespacing when used
downstream.
  • Loading branch information
toumorokoshi committed Dec 4, 2024
1 parent 2ad17c0 commit 0a7e130
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions pkg/api/openapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"strings"

"github.com/aep-dev/aep-lib-go/pkg/constants"
"github.com/aep-dev/aep-lib-go/pkg/openapi"
)

Expand Down Expand Up @@ -81,7 +82,7 @@ func ConvertToOpenAPI(api *API) (*openapi.OpenAPI, error) {
},
}
if r.ListMethod.HasUnreachableResources {
responseProperties[FIELD_UNREACHABLE_NAME] = openapi.Schema{
responseProperties[constants.FIELD_UNREACHABLE_NAME] = openapi.Schema{
Type: "array",
Items: &openapi.Schema{
Type: "string",
Expand All @@ -92,13 +93,13 @@ func ConvertToOpenAPI(api *API) (*openapi.OpenAPI, error) {
Parameters: append(pwp.Params,
openapi.Parameter{
In: "query",
Name: FIELD_MAX_PAGE_SIZE_NAME,
Name: constants.FIELD_MAX_PAGE_SIZE_NAME,
Required: true,
Type: "integer",
},
openapi.Parameter{
In: "query",
Name: FIELD_PAGE_TOKEN_NAME,
Name: constants.FIELD_PAGE_TOKEN_NAME,
Required: true,
Type: "string",
},
Expand Down Expand Up @@ -159,7 +160,7 @@ func ConvertToOpenAPI(api *API) (*openapi.OpenAPI, error) {
if len(r.Children) > 0 {
params = append(params, openapi.Parameter{
In: "query",
Name: FIELD_FORCE_NAME,
Name: constants.FIELD_FORCE_NAME,
Required: false,
Type: "boolean",
})
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/constants.go → pkg/constants/constants.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package api
package constants

const (
FIELD_FORCE_NAME = "force"
Expand Down

0 comments on commit 0a7e130

Please sign in to comment.