Skip to content

Commit

Permalink
fix: fix serviceIndex import
Browse files Browse the repository at this point in the history
  • Loading branch information
rookie-luochao committed Jul 7, 2024
1 parent aa1ae31 commit 98ef7b3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/ninety-colts-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'openapi-ts-request': patch
---

fix: fix serviceIndex import
1 change: 1 addition & 0 deletions src/generator/serviceGenarator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ export default class ServiceGenerator {
namespace: this.config.namespace,
interfaceFileName: interfaceFileName,
schemaFileName: schemaFileName,
isGenJsonSchemas: this.config.isGenJsonSchemas,
}
);

Expand Down
5 changes: 5 additions & 0 deletions templates/serviceIndex.njk
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
/* eslint-disable */
// @ts-ignore
import * as {{ namespace }} from './{{ interfaceFileName }}';
{%- if isGenJsonSchemas %}
import * as schemas from './{{ schemaFileName }}';
{%- endif %}

{% for api in list -%}
import * as {{ api.controllerName }} from './{{ api.fileName }}';
{% endfor -%}

export default {
{%- if isGenJsonSchemas %}
schemas,
{%- endif %}
{{ namespace }},
{% for api in list -%}
{{ api.controllerName }},
Expand Down

0 comments on commit 98ef7b3

Please sign in to comment.