I have a pydantic model set up like this:
class MyModel(pydantic.BaseModel):
country_code: CountryCode
Then I run a OpenAPI schema validator against the generated schema found here: https://github.com/p1c2u/openapi-spec-validator
Getting an issue in the anyOf below, on examples. Not sure if it's misplaced?
{
"type": "string",
"title": "Alpha2",
"description": "ISO3166-1 alpha-2 country code",
"examples": [
"NR",
"KZ",
"ET",
"VC",
"AE",
"NZ",
"SX",
"XK",
"AX"
],
"format": "iso3166-1 alpha-2"
}
Anyways, removing examples from there everything works fine. Perhaps it should move someplace else? I tried moving it on the "root" level of the field object (sibling to anyOf) but that didn't work either.