Closed dilanka-cacib closed 2 hours ago
Hi @dilanka-cacib, thanks for reporting this issue. We will look into this and get back to you.
Hi @dilanka-cacib,
It looks like the issue you're facing is due to conflicting constraints in the iso2Code
schema:
- name: iso2Code
in: path
description: iso2Code
required: true
style: simple
explode: false
schema:
maxLength: 2
pattern: .+
type: string
In this case, maxLength: 2
limits the iso2Code
to 2 characters, while the pattern
.+
allows any length greater than 1. These conflicts are causing inconsistent behavior in Specmatic.
To resolve this, updating the schema to the following should fix the issue:
- name: iso2Code
in: path
description: iso2Code
required: true
style: simple
explode: false
schema:
maxLength: 2
pattern: ^.{1,2}$
type: string
This ensures the pattern
and maxLength
are aligned. We're also planning to address this nuance in Specmatic soon.
Let us know if you need further assistance, and feel free to reopen the issue if it's not resolved.
Best regards!
Hi @yogeshnikam671,
Thanks for the quick reply. I will test as you suggested.
Thanks
Description When I use same OpenAPI file to compare for backward compatibility check. It gives result as 'The newer contract is not backward compatible'
Steps to reproduce
Expected behavior Since I am using the same OpenAPI file, it should give the result as 'The newer contract is backward compatible.'. But I receive the result as 'The newer contract is not backward compatible.'
Screenshots
System Information: