we decided to move from using swagger-cli to openapi-spec-validator for validating our API specs as swagger-cli seems to be deprecated.
Below spec is failing with openapi-spec-validator,
abcd-spec.yaml
swagger: "2.0"
consumes:
- application/json
produces:
- application/json
schemes:
- http
info:
description: abcd
title: Mobile App Configuration
version: "1.0"
host: api.abcd.com
paths:
.
.
/* api paths etc */
.
.
When I tried the below command in cli,
openapi-spec-validator abcd-spec.yaml
it gives me below error,
Validating open-api/mobile-configuration-v1-openapi.yaml... # Validation Error
'openapi' is a required property
Failed validating 'required' in schema:
{'$schema': 'http://json-schema.org/draft-04/schema#',
'additionalProperties': False,
......
I have read that openapi-spec-validator supports swagger 2.0, but not sure why it fails here.
OpenAPI Spec Validator is a CLI, pre-commit hook and python package that validates OpenAPI Specs against the OpenAPI 2.0 (aka Swagger), OpenAPI 3.0 and OpenAPI 3.1 specification. The validator aims to check for full compliance with the Specification.
Can someone please suggest what I am doing wrong?