美文网首页
swagger+jest

swagger+jest

作者: heliping_peter | 来源:发表于2019-02-18 16:25 被阅读0次
    1. 下载swagger的doc
    2. 使用swagger codegen生成client
    java -jar swagger-codegen-cli-2.4.1.jar generate -i swagger.yaml -l javascript -o abc
    
    1. 使用client
    var SwaggerPetstore = require('swagger_petstore');
    
    var apiInstance = new SwaggerPetstore.StoreApi();
    var callback = function(error, data, response) {
      if (error) {
        console.error(error);
      } else {
        console.log('API called successfully. Returned data: ' + data.test);
      }
    };
    apiInstance.getInventory(callback);
    

    相关文章

      网友评论

          本文标题:swagger+jest

          本文链接:https://www.haomeiwen.com/subject/ggzaeqtx.html