Example #1
0
 def get_spec(self) -> ArgList:
     return [Field(None, self.actual_type, False)]
Example #2
0
 def get_spec(self) -> ArgList:
     return [Field('values', List[self.row_type], False)]
Example #3
0
 def get_spec(self) -> ArgList:
     return [Field(None, self._get_subtype(self.shape[1:]), False)]
Example #4
0
def test_create_spec__no_file():
    field = Field('field', int, False)
    spec = create_spec('mymethod', Signature([field], field))

    assert spec == {
        'definitions': {
            'error': {
                'type': 'object',
                'properties': {
                    'error': {
                        'type': 'string'
                    },
                    'ok': {
                        'type': 'boolean'
                    }
                }
            },
            'request_mymethod': {
                'type': 'object',
                'properties': {
                    'field': {
                        'type': 'integer'
                    }
                }
            },
            'response_mymethod': {
                'type': 'object',
                'properties': {
                    'data': {
                        'type': 'integer'
                    },
                    'ok': {
                        'type': 'boolean'
                    }
                }
            }
        },
        'parameters': [{
            'in': 'body',
            'name': 'body',
            'required': True,
            'schema': {
                '$ref': '#/definitions/request_mymethod'
            }
        }],
        'responses': {
            '200': {
                'description': 'resp descr',
                'schema': {
                    '$ref': '#/definitions/response_mymethod'
                }
            },
            '400': {
                'description': 'resp descr',
                'schema': {
                    '$ref': '#/definitions/error'
                }
            }
        },
        'summary':
        'mymethod'
    }
Example #5
0
 def get_spec(self):
     return [Field(c, python_type_from_pd_string_repr(d), False) for c, d in zip(self.columns, self.dtypes)]
Example #6
0
 def get_spec(self) -> ArgList:
     return [Field('field', int, False), Field('field', str, False)]
Example #7
0
 def get_spec(self) -> ArgList:
     return [Field(name, t, False) for name, t in self.item_types.items()]
Example #8
0
 def get_spec(self) -> ArgList:
     return [Field(i, t, False) for i, t in enumerate(self.items)]
Example #9
0
 def get_spec(self) -> ArgList:
     return [Field('file', bytes, False)]
Example #10
0
 def get_spec(self) -> ArgList:
     return [
         Field(n, t, False)
         for n, t in zip(self.feature_names, self.feature_types)
     ]