openapi3-parser
openapi3-parser copied to clipboard
[BUG] Resolver doesnt handle %7B -> { or %7D -> }
Describe the bug Openapi supports $ref to another file. when there is a path you need to encode / as ~1. {} needs to be %7B and %7D.
openapi_parser.errors.ParserError: OpenAPI file parsing error: Cannot resolve reference "file:///path/openapi-split/openapi-audit.yaml#/paths/~1audit~1export~1csv~1%7BexportId%7D": 'Object at "/paths" does not contain key: /audit/export/csv/%7BexportId%7D'
To Reproduce Steps to reproduce the behavior:
- use a $ref for a path with {} encoded.
- use content = parse("/path/openapi.yaml")
- See error
Expected behavior The parser should support the encoded paths and translate them when resolving the $ref.
System details (please complete the following information):
- OS: MAC 15.5
- OpenAPI / Swagger version 3.0.1
- Python version Python 3.11.1
Hey @dicolanl! This parser uses prance behind the scenes to resolve $ref usage. Could you please check if the latest version works for your case?
Ill try. traveling and quick try couldnt get prance installed or running...