prance icon indicating copy to clipboard operation
prance copied to clipboard

parsing subset of api spec

Open nklskyoy opened this issue 3 years ago • 1 comments

Discussed in https://github.com/RonnyPfannschmidt/prance/discussions/125

Originally posted by onikolskyy February 9, 2022 For some purpose, I would like to parse only the components part of a swagger api spec.

However, when I use ResolvingParser('apischemas/schemas.yaml'), I get the exception

prance.ValidationError: ("'paths' is a required property [...]

Here's my schemas.yaml

openapi: '3.0.0'

info:
  title: 'api'
  version: '0.2'

components:
  schemas:

    ANALYSIS:
      $ref: "./schemas/common/analysis.yaml"
    LAB:
      $ref: "./schemas/LAB.yaml"^
    FAB:
      $ref: "./schemas/FAB.yaml"
    OPS: 
      $ref: "./schemas/OPS.yaml"
    ICD:
      $ref: "./schemas/ICD.yaml"
    FALL:
      $ref: "./schemas/FALL.yaml"

Is there a way to resolve only th components property?

nklskyoy avatar Feb 09 '22 19:02 nklskyoy

currently prance is designed to handle/resolve the full spec only

its not clear to me how to enable the subset

RonnyPfannschmidt avatar Feb 22 '23 11:02 RonnyPfannschmidt