as we treat properties as schemas, so if the items property is used anywhere before, then the second usage will get the cached value with the wrong schema reference:
The quick (and nasty) solution might be not to cache any "schema" starting with lowercase letter, something like:
$firstLetter = substr($name ?? '', 0, 1);
// We occasionally want schemas to be anonymous, like an inline schema in an allOf.
// There's no good way to name them, and we can parse them without a name
if ($name && $firstLetter === strtoupper($firstLetter)) {
$this->normalizedSchemas[$name] = $schema;
}
but I guess there is a better option there. It was just my quick digging around what's wrong when trying to migrate to v6.
This caching is too aggressive:
https://github.com/highsidelabs/saloon-sdk-generator/blob/eacbcf7f53e9030bbcd5a2a92c0dd60ad7b2f51b/src/Normalizers/OpenApiNormalizer.php#L127-L129
as we treat properties as schemas, so if the
items
property is used anywhere before, then the second usage will get the cached value with the wrong schema reference:See: https://github.com/jlevers/selling-partner-api/issues/726
The quick (and nasty) solution might be not to cache any "schema" starting with lowercase letter, something like:
but I guess there is a better option there. It was just my quick digging around what's wrong when trying to migrate to v6.