You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @souliane. Unfortunately, the change would not be as simple as that - there are implications for interoperability with the jvm and Rust implementations.
There is some confusion, seen in the other comments. The "application/json" media type allows only object or array at the top-level for JSON-text, per JSON RFC.
How would the jvm and Rust implementations handle this?
@souliane putting aside the implementation details, using a string as a top level element is generally considered to be bad practice, as it doesn't allow for any extensibility in the future, is poorly supported (as evidenced by the issue you have raised) and according to the stackoverflow post mentioned above, has security implications. Is there a particular reason why you can't use an object?
Please set the option ":quirks_mode => true" when calling JSON.parse in
pact/consumer/mock_service/rack_request_helper.rb, line 31.
Ruby JSON library doesn't consider serialized string as a correct JSON value (which is is false statement!) and this quirks_mode is needed for working with string encoded as JSON:
https://makandracards.com/makandra/15611-how-to-fix-unexpected-token-error-for-json-parse
The text was updated successfully, but these errors were encountered: