File: shortcuts.py

package info (click to toggle)
python-openapi-spec-validator 0.7.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 772 kB
  • sloc: python: 2,050; makefile: 54
file content (10 lines) | stat: -rw-r--r-- 362 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
from jsonschema_path.typing import Schema

from openapi_spec_validator.versions.consts import VERSIONS
from openapi_spec_validator.versions.datatypes import SpecVersion
from openapi_spec_validator.versions.finders import SpecVersionFinder


def get_spec_version(spec: Schema) -> SpecVersion:
    finder = SpecVersionFinder(VERSIONS)
    return finder.find(spec)