Skip to content

Check for unbalanced|nested braces #9

Open

Description

@charjr

templated urls cannot have unbalanced braces. i.e.

https://www.server/{version} is allowed
https://www.server/{version is not

templated urls also cannot nest braces. i.e.

https://www.server/{version}/{platform} is allowed
https://www.server/{version{platform}} is not

Currently Membrane-core checks this in each ExtractPathParameters implementation:

https://github.com/membrane-php/membrane-core/blob/dcb21bc53aba3463e74212b136a647776192eada/src/OpenAPI/ExtractPathParameters/PathParameterExtractor.php#L25-L39

https://github.com/membrane-php/membrane-core/blob/dcb21bc53aba3463e74212b136a647776192eada/src/OpenAPI/ExtractPathParameters/PathMatcher.php#L30-L40

Currently OpenAPI Router does not check this, but it would be handy for users to know.

Logic should be moved from membrane-core to the openapi-reader.

Not 100% sure if it counts as an "invalid OpenAPI" to have unbalanced braces but it's certainly not helpful for routing and parsing in the rest of Membrane.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions