def get_ref_dict ( self , schema ) : schema_key = make_schema_key ( schema ) ref_schema = build_reference ( "schema" , self . openapi_version . major , self . refs [ schema_key ] ) if getattr ( schema , "many" , False ) : return { "type" : "array" , "items" : ref_schema } return ref_schema
python generate json based on jsonschema definition
Method to create a dictionary containing a JSON reference to the schema in the spec
def get_ref_dict(self, schema):
        """Method to create a dictionary containing a JSON reference to the
        schema in the spec
        """
        schema_key = make_schema_key(schema)
        ref_schema = build_reference(
            "schema", self.openapi_version.major, self.refs[schema_key]
        )
        if getattr(schema, "many", False):
            return {"type": "array", "items": ref_schema}
        return ref_schema