open-rpc/test-coverage

Option to validate schema of method results, and not compare values

mersinvald opened this issue · 0 comments

Why?

In some cases the output of a method may be randomized, hence it's impossible to match the result value one-to-one with an examples defined in the openrpc.json schema. One way around it would be optionally dropping the value check and performing just schema check instead (to at least ensure the correct object is returned).

Possible solution

We could add the --only-validate-result-schema flag (or a shorter one) that

  • if passed without a parameter, skips value matching for all tests
  • if passed with a comma-separated list of methods, skips value matching for the provided methods