The Python OpenAPI3-parser library currently lacks support for RFC 7807, leading to an issue when handling the application/problem+json content type. According to RFC 7807, this content type is commonly used for representing errors in a machine-readable format, allowing for standardized error responses.
Problem
When attempting to process errors using the application/problem+json content type, the library raises an exception, hindering the smooth integration of error handling in accordance with RFC 7807.
Expected Behavior
The OpenAPI3-parser library should provide support for RFC 7807, allowing users to seamlessly handle error responses in the specified JSON format without encountering exceptions.
Steps to Reproduce
Define an OpenAPI specification that includes error responses conforming to RFC 7807.
Implement a build process using the OpenAPI3-parser library.
Trigger an error response with the application/problem+json content type.
Current Behavior
The library raises an exception when attempting to process the error response with the application/problem+json content type.
Proposed Solution
Implement support for RFC 7807 in the OpenAPI3-parser library, ensuring that the application/problem+json content type is handled without raising exceptions. This enhancement will enable users to seamlessly integrate standardized error handling into their applications.
Updating the enum ContentType in the file openapi_parser/enumeration.py by adding an entry `JSON_PROBLEM = 'application/problem+json' resolves this issues.
Impact
This improvement will benefit users who rely on RFC 7807 for consistent error representations and enhance the overall compatibility of the OpenAPI3-parser library with industry standards.
Description
The Python OpenAPI3-parser library currently lacks support for RFC 7807, leading to an issue when handling the application/problem+json content type. According to RFC 7807, this content type is commonly used for representing errors in a machine-readable format, allowing for standardized error responses.
Problem
When attempting to process errors using the application/problem+json content type, the library raises an exception, hindering the smooth integration of error handling in accordance with RFC 7807.
Expected Behavior
The OpenAPI3-parser library should provide support for RFC 7807, allowing users to seamlessly handle error responses in the specified JSON format without encountering exceptions.
Steps to Reproduce
Current Behavior
The library raises an exception when attempting to process the error response with the application/problem+json content type.
Proposed Solution
Implement support for RFC 7807 in the OpenAPI3-parser library, ensuring that the application/problem+json content type is handled without raising exceptions. This enhancement will enable users to seamlessly integrate standardized error handling into their applications.
Updating the enum
ContentType
in the fileopenapi_parser/enumeration.py
by adding an entry `JSON_PROBLEM = 'application/problem+json' resolves this issues.Impact
This improvement will benefit users who rely on RFC 7807 for consistent error representations and enhance the overall compatibility of the OpenAPI3-parser library with industry standards.