¿Cómo puedo generar swagger basado en postman existente? [cerrado]


Estoy desarrollando una API REST. durante el desarrollo he utilizado postman (extensión de Chrome) para usar y documentar mi API. Maravillosa herramienta y tengo la mayoría de los puntos finales en ella. Sin embargo, a medida que nos acercamos al lanzamiento, me gustaría documentar esta API en swagger, ¿cómo lo haría? ¿Hay alguna forma de que pueda generar swagger basado en la exportación de postman?

Author: StuBob, 2015-07-08

3 answers

APIMatic API Transformer puede procesar una colección Postman (v1 o v2) como formato de entrada y producir Swagger 1.2 o 2.0, y ahora OpenAPI 3.0.0 como salida.

Tiene su propia API y un front-end web.

 35
Author: MikeRalphson,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-06-14 09:52:48

Alguien publicó este enlace (y eliminado?): http://restunited.com /

Acepta postman JSON y lo convierte en swagger. Esto parece ser lo que estaba buscando.

 7
Author: StuBob,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-07-13 15:23:13

Puede utilizar https://github.com/stoplightio/api-spec-converter con el código

var transformer = require('api-spec-transformer');

var postmanToSwagger = new transformer.Converter(transformer.Formats.POSTMAN, transformer.Formats.SWAGGER);

postmanToSwagger.loadFile('/path/to/your.json.postman_collection', function(err) {
  if (err) {
    console.log(err.stack);
    return;
  }

  postmanToSwagger.convert('yaml')
    .then(function(convertedData) {
      // convertedData is swagger YAML string
      console.log(convertedData);
    })
    .catch(function(err){
      console.log(err);
    });
});
 2
Author: plotnik,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-03-19 15:48:38