From 819f41bb1fbeb62eea5d3b1130da9ea595b5f33a Mon Sep 17 00:00:00 2001 From: Colin Eberhardt Date: Wed, 7 Dec 2022 10:41:44 -0500 Subject: [PATCH] fix: README file now outputs tagged API --- template/README.md.handlebars | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/template/README.md.handlebars b/template/README.md.handlebars index 1f1fdb6..d32fe2a 100644 --- a/template/README.md.handlebars +++ b/template/README.md.handlebars @@ -5,17 +5,19 @@ This is an auto-generated client library for the {{info.title}} API, via the `op ## Usage example {{#each paths}}{{#with get}}{{#unless @root.apiMethod}}{{setVar "apiMethod" this}}{{/unless}}{{/with}}{{/each}} {{#each components.schemas}}{{#unless @root.modelObject}}{{setVar "modelObject" @key}}{{/unless}}{{/each}} +{{#each _tags}}{{#unless @root.tagName}}{{setVar "tagName" this.name}}{{/unless}}{{/each}} ``` -import Api from "./api"; -import Configuration from "./configuration"; +const Api{{tagName}} = require("./api{{tagName}}"); +const Configuration = require("./configuration"); +const transport = require("./nodeFetch"); // import any model types you need -import { {{modelObject}} } from "./api/model"; +const { {{modelObject}} } = require("./api/model"); -const config = new Configuration(); +const config = new Configuration(transport); // set the base path for your endpoint config.basePath = "https://example.com"; // set any environment specific configuration here -const api = new Api(config); +const api = new Api{{tagName}}(config); api.{{apiMethod.operationId}}(...).then((data) => { // log the result