Skip to content

Validating null or not null value #372

Answered by thim81
shubhambajad asked this question in Q&A
Discussion options

You must be logged in to vote

hi @shubhambajad

The Schema validation would be checking if the required fields are present.

{
  "version": 1.0,
  "tests": {
    "contractTests": [
      {
        "openApiOperation": "*::/crm/*",
        "schemaValidation": {
          "enabled": true
        }
      }
     ]
   }
}

If you want to do specific checks for a field, Portman provides contentTests.
Via content tests, you can target specific endpoints, and do checks like: key

All the options are described here: https://github.com/apideck-libraries/portman#portman---contenttests-properties
Or in the provided example: https://github.com/apideck-libraries/portman/tree/main/examples/testsuite-content-tests

It seems that for your q…

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
3 replies
@shubhambajad
Comment options

@thim81
Comment options

@shubhambajad
Comment options

Answer selected by shubhambajad
Comment options

You must be logged in to vote
4 replies
@shubhambajad
Comment options

@thim81
Comment options

@thim81
Comment options

@shubhambajad
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants