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-angular] Invalid regular expression error #6566

Closed
kimamula opened this issue Sep 26, 2017 · 8 comments
Closed

[typescript-angular] Invalid regular expression error #6566

kimamula opened this issue Sep 26, 2017 · 8 comments

Comments

@kimamula
Copy link

Description

The code generated from the following template results in a runtime error, Invalid regular expression: /(?i)^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$/: Invalid group

const jsonMime: RegExp = new RegExp('(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$');

Swagger-codegen version

Master branch (2.3.0)

Steps to reproduce

Paste the regular expression in Chrome Developer console, and Chrome raises the syntax error.

@taxpon
Copy link
Contributor

taxpon commented Sep 26, 2017

@wing328 I think we need to add some basic tests for angular and run them on CI in order to avoid this kind of bugs. What do you say?

@wing328
Copy link
Contributor

wing328 commented Sep 26, 2017

@taxpon definitely. It's better to rely on CI to catch similar issue moving forward.

@wing328
Copy link
Contributor

wing328 commented Sep 26, 2017

Btw, npm run build didn't catch this issue so we need to write some integration tests similar to what we've done for TS Fetch: https://github.com/swagger-api/swagger-codegen/tree/master/samples/client/petstore/typescript-fetch

@wing328
Copy link
Contributor

wing328 commented Sep 26, 2017

@mattrc
Copy link

mattrc commented Sep 26, 2017

+1

@gimre
Copy link

gimre commented Sep 27, 2017

+1 - also worth mentioning that typescript-angular is still using the old and about-to-be-deprecated HttpModule instead of HttpClientModule

@kenisteward
Copy link
Contributor

kenisteward commented Sep 27, 2017 via email

yissachar added a commit to yissachar/swagger-codegen that referenced this issue Sep 27, 2017
@wing328
Copy link
Contributor

wing328 commented Sep 28, 2017

@kimamula the issue has been fixed by #6584. Please pull the latest master to give it a try.

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

No branches or pull requests

6 participants