Hey folks :wave: does anyone know if it’s possible...
# pact-jvm
j
Hey folks 👋 does anyone know if it’s possible to write contract tests for Java services that communicate using JSON-RPC?
m
Is that over HTTP or sockets I can't remember? You could probably model it with message pact if the latter. If the former you might need to create a content type plugin
j
I think ours is over HTTP, is there any documentation on writing a plugin?
m
see also #C047TCR7B6W
j
Awesome thanks Matt 😅
👍 1
Someone in my team just pointed me towards https://open-rpc.org/ which seems to be the OpenAPI Spec equivalent for JSON-RPC Do you know if it would be possible to get bi-directional contract testing working using this? I’m happy to try and do some of the additional work if it’s needed
m
Ahh, interesting. We definitely don’t support that in BDCT but it’s not implausible that we could. For that to happen we’d need to do a few things though (high level list): 1. Add support for parsing OpenRPC documents (potentially via https://github.com/pactflow/swagger-mock-validator, but possibly via a different tool, and comparing to pact files 2. Add support in Pactflow for displaying, rendering and handling those document types 3. Add support in Pact for generating client contracts compatible with (1) I’m guessing it can’t be expressed in a standard OAS because it can have multiple requests? I’m wondering if it could be expressed in an AsyncAPI document? (something which we do plan to support)
In the meantime, I think you could just get away with using standard message pact
j
That’s awesome to hear, thanks for taking a look Matt 😄 I’ll get cracking with message pact for now but hopefully in the future we can migrate to BDCT fingerscrossed thanks again
🙌 1