Ejemplo n.º 1
0
 def generate(self, paths):
     paths_deref = self.dereferencer.dereference(paths)
     for path_name, path in iteritems(paths_deref):
         operations = self.operations_generator.generate(path_name, path)
         parameters = self.parameters_generator.generate_from_list(
             path.get('parameters', {}))
         yield path_name, Path(path_name, list(operations), parameters)
Ejemplo n.º 2
0
    def generate(self, paths):
        paths_deref = self.dereferencer.dereference(paths)
        for path_name, path_spec in iteritems(paths_deref):
            path_deref = self.dereferencer.dereference(path_spec)

            parameters_list = path_deref.get('parameters', [])
            summary = path_deref.get('summary')
            description = path_deref.get('description')
            servers_spec = path_deref.get('servers', [])

            operations = self.operations_generator.generate(
                path_name, path_deref)
            servers = self.servers_generator.generate(servers_spec)
            parameters = self.parameters_generator.generate_from_list(
                parameters_list)
            extensions = self.extensions_generator.generate(path_deref)

            yield (
                path_name,
                Path(
                    path_name,
                    list(operations),
                    parameters=list(parameters),
                    summary=summary,
                    description=description,
                    servers=list(servers),
                    extensions=extensions,
                ),
            )
Ejemplo n.º 3
0
 def path(self, operations, parameters):
     return Path(self.path_name, operations, parameters=parameters)
Ejemplo n.º 4
0
 def path(self, operations):
     return Path(self.path_name, operations)
Ejemplo n.º 5
0
 def path_2(self, operations_2):
     return Path('/keys/{id}/tokens', operations_2)
Ejemplo n.º 6
0
 def path(self, operations):
     return Path('/tokens', operations)
Ejemplo n.º 7
0
 def path(self, operations, servers):
     return Path(self.path_name, operations, servers=servers)
Ejemplo n.º 8
0
 def path(self):
     operations = {
         'get': mock.sentinel.get,
         'post': mock.sentinel.post,
     }
     return Path('/path', operations)
Ejemplo n.º 9
0
 def path2(self):
     operations = {
         'post': mock.sentinel.path2_psot,
     }
     return Path('path2', operations)
Ejemplo n.º 10
0
 def path1(self):
     operations = {
         'get': mock.sentinel.path1_get,
     }
     return Path('path1', operations)
Ejemplo n.º 11
0
 def path(self, operations):
     return Path('/keys/{id}/tokens/{id2}', operations)
Ejemplo n.º 12
0
 def path_2(self, operations_2):
     return Path('/keys/master/tokens', operations_2)
Ejemplo n.º 13
0
 def generate(self, paths):
     paths_deref = self.dereferencer.dereference(paths)
     for path_name, path in iteritems(paths_deref):
         operations = self.operations_generator.generate(path_name, path)
         yield path_name, Path(path_name, list(operations))