Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def correct_namespace(name, api_name, env_name) -> bool:
:param api_name: The meta.api.name item from your manifest
:param env_name: The environment name (e.g. 'internal-dev', 'int', or 'prod')
"""
regex = f"^{api_name}(-[a-z]+)*-{env_name}(-[a-z]+)*$"
regex = f"^{api_name}(-[a-z0-9]+)*-{env_name}(-[a-z0-9]+)*$"
return bool(re.match(regex, name))


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ def test_correct_namespace_with_both_types_of_suffix():
assert correct_namespace("canary-api-suffix-internal-dev-application-restricted", API_NAME, ENV_NAME) is True


def test_correct_namespace_with_number_in_suffix():
assert correct_namespace("canary-api-suffix1-internal-dev-suffix2", API_NAME, ENV_NAME) is True


def test_correct_namespace_missing_hyphen_1():
assert correct_namespace("canary-apisuffix-internal-dev-application-restricted", API_NAME, ENV_NAME) is False

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
"items": {
"anyOf": [
{
"anyOf": [
"oneOf": [
{
"$ref": "#/definitions/ApigeeProductAttributeAccess"
},
Expand Down