Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Column is not a valid date

asuvorkov
asuvorkov Posts: 4
edited February 2022 in SOAtest

While I am testing REST API I get such kind of error messages:

I don't want Parasoft to validate if date format is valid. I want to switch off this in Parasoft. Is it possible? If yes, how?

What I want - everything as input should be interpreted in Parasoft as a string. And then endpoint will decide, if the input string is valid.

Tagged:

Best Answers

  • asuvorkov
    asuvorkov Posts: 4
    Answer ✓

    I have found a solution. In the cofiguration should be disabled fix problems settings like this:

    After this change Parasoft takes every input as a string and not trying to validate or even fix it.

  • benken_parasoft
    benken_parasoft Posts: 1,306 ✭✭✭
    Answer ✓

    You have suggested to disable "Enforce Schema Type", but I could not find this setting

    This is available in the Form JSON and Form Input views on the Payload tab. However, I now see you are using query parameters which does not have this option available.

    Since you need to violate the constraints defined by your OpenAPI service definition (yaml file), I would recommend switching the "Service Definition" field from "OpenApi/Swagger" to "None". This will keep the settings for your query parameters but without any type checking.

Answers

  • benken_parasoft
    benken_parasoft Posts: 1,306 ✭✭✭

    Are you using a REST Client test? What tools do you have chained to your REST Client? Probably one of them is configured to perform this validation. For example, if you configured an Assertor tool to validate against dates from a data source, and your data source does not contain dates, then your Assertor tool is going to produce errors like this, since it was configured incorrectly.

  • asuvorkov
    asuvorkov Posts: 4

    I am very new to Parasoft, so I don't know if I am using REST Client test. How to check this?

    I am testing REST endpoints and use git as plugin in Parasoft. How can I check an Assertor tool settings?

  • benken_parasoft
    benken_parasoft Posts: 1,306 ✭✭✭

    In the cofiguration should be disabled fix problems settings like this

    This just means you won't see any test failures when they happen, including ones you may actually care about including errors returned by your application-under-test.

    How can I check an Assertor tool settings?

    You can right-click on the parent node of the test failure then click "Show in Test Case Explorer". This will select the test that failed. You can open the test and view its configured settings.

    On second thought, the error might not be coming from an Assertor tool you added but might be coming from message you have configured on the Payload tab of your test. If you are configuring an XML element or JSON property/item with an invalid date then you can right-click the element or JSON property/item then click "Enforce Schema Type" to disable it.

  • asuvorkov
    asuvorkov Posts: 4

    This just means you won't see any test failures when they happen, including ones you may actually care about including errors returned by your application-under-test.

    You are right. So.. the problem still remains

    You can right-click on the parent node of the test failure then click "Show in Test Case Explorer". This will select the test that failed. You can open the test and view its configured settings.

    Everything seems to be ok.

    On second thought, the error might not be coming from an Assertor tool you added but might be coming from message you have configured on the Payload tab of your test.

    I have a payload, which is disabled because of GET REST command

    If you are configuring an XML element or JSON property/item with an invalid date then you can right-click the element or JSON property/item then click "Enforce Schema Type" to disable it.

    This is interesting, because I am using yaml file, which has definitions like this:

    Here formats are commented out, but real yaml file has no comments. I asume, that parasoft takes this definitions and checks if input format is the same as yaml definition format. I want this to disable.

    You have suggested to disable "Enforce Schema Type", but I could not find this setting. Google didn't help either. Could you please provide an example maybe with screenshot, so I can understand where to look?