There are many (https://openapi.tools/#description-validators) validators available to assure that an OpenAPI spec is valid.
In order to prevent publishing an invalid spec, I suggest using these internally.