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(openapi): use 3.1 version #5489

Merged
merged 1 commit into from
Mar 23, 2023
Merged

Conversation

soyuka
Copy link
Member

@soyuka soyuka commented Mar 23, 2023

Configuration now validates the api keys "key" using the pattern from the OpenAPI 3.1 specification: https://github.com/OAI/OpenAPI-Specification/blob/main/schemas/v3.1/schema.json#L282

@@ -280,6 +280,10 @@ private function addSwaggerSection(ArrayNodeDefinition $rootNode): void
->end()
->arrayNode('api_keys')
->useAttributeAsKey('key')
->validate()
->ifTrue(static fn($v): bool => empty(array_filter(array_keys($v), fn($item) => preg_match('/^[a-zA-Z0-9._-]+$/', $item))))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
->ifTrue(static fn($v): bool => empty(array_filter(array_keys($v), fn($item) => preg_match('/^[a-zA-Z0-9._-]+$/', $item))))
->ifTrue(static fn($v): bool => !empty(array_filter(array_keys($v), fn($item) => !preg_match('/^[a-zA-Z0-9._-]+$/', $item))))

@soyuka soyuka merged commit ccef472 into api-platform:main Mar 23, 2023
soyuka added a commit to mrossard/core that referenced this pull request Apr 14, 2023
Deuchnord pushed a commit to Deuchnord/api-platform-core that referenced this pull request Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants