Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TypeScript] Package structure error #9822

Open
hypery2k opened this issue Oct 31, 2019 · 0 comments
Open

[TypeScript] Package structure error #9822

hypery2k opened this issue Oct 31, 2019 · 0 comments
Assignees

Comments

@hypery2k
Copy link

Description

When using the codegen plugin for generating Angular API package the package structure seems to be not resolvable:


Bundling to UMD
[INFO] ERROR: Could not resolve './absencesController.service' from dist/fesm5/my-api-client.js

What's really strange here, it was working about a week ago, not sure if it's just was same build cache stuff

Swagger-codegen version

3.0.12

Swagger declaration file content or url

not related to swagger declaration

Command line used for generation

Just the Maven Plugin:

<plugin>
            <groupId>io.swagger.codegen.v3</groupId>
            <artifactId>swagger-codegen-maven-plugin</artifactId>
            <version>${swagger-codegen-plugin.version}</version>
            <executions>
              <execution>
                <id>generate-client-stubs</id>
                <phase>test</phase>
                <goals>
                  <goal>generate</goal>
                </goals>
                <configuration>
                  <output>target/frontend/api-client</output>
                  <inputSpec>${project.build.directory}/swagger.json</inputSpec>
                  <language>typescript-angular</language>
                  <apiPackage>api</apiPackage>
                  <modelPackage>model</modelPackage>
                  <configOptions>
                    <npmName>myapi-client</npmName>
                    <npmVersion>${project.version}</npmVersion>
                    <ngVersion>8.2.0</ngVersion>
                  </configOptions>
                </configuration>
              </execution>
            </executions>
          </plugin>
Steps to reproduce

Just add the maven plugin.

Will try to add a java testcase for it

Related issues/PRs

N/A

Suggest a fix/enhancement

This is caused by this structure:

api-client
  |-model
  |  \-model.ts
  |-package.json
...

model.ts should be named index.ts, because there seems errors when using the same name for folder and imported file.

Going to try a PR for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants