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

Pattern: Valid pattern throwing error #104

Open
mbana opened this issue Oct 4, 2018 · 3 comments
Open

Pattern: Valid pattern throwing error #104

mbana opened this issue Oct 4, 2018 · 3 comments

Comments

@mbana
Copy link

mbana commented Oct 4, 2018

I am getting tthe below error for this swagger file: https://raw.githubusercontent.com/OpenBankingUK/payment-initiation-api-spec/master/dist/v1.1/payment-initiation-swagger.json.

...
ERROR - operation "CreateSingleImmediatePayment" has invalid pattern in param "x-idempotency-key": "^(?!\\s)(.*)(\\S)$"
...

Definition:

{
    "name": "x-idempotency-key",
    "in": "header",
    "description": "Every request will be processed only once per x-idempotency-key.  The Idempotency Key will be valid for 24 hours.",
    "required": true,
    "type": "string",
    "pattern": "^(?!\\s)(.*)(\\S)$",
    "maxLength": 40
}
@fredbi
Copy link
Member

fredbi commented Oct 4, 2018

That's because we don't strictly support ECMA regexp, but follow golang implementation.

Operator ?! is not supported by go regexp.

Try it out there: https://regex-golang.appspot.com/assets/html/index.html

@mbana
Copy link
Author

mbana commented Oct 4, 2018

@fredbi, modifying the swagger is out of the question.
What do you suggest I do?

@casualjim
Copy link
Member

you can make use of our mixin command which allows you to patch a swagger spec.
That allows you to pre-process the swagger specification and then run the code generation step.

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

3 participants