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

fix code-gen #45

Merged
merged 1 commit into from
Jan 24, 2022
Merged

fix code-gen #45

merged 1 commit into from
Jan 24, 2022

Conversation

jacopocarlini
Copy link
Contributor

@jacopocarlini jacopocarlini commented Jan 20, 2022

List of Changes

This PR fixes a bug in the code-gen lib:
library creates a broken client from the swagger when custom X-Request-Id header is present. To solve the problem, a python script removes the custom header from the swagger.json file. This works because the header is optional.

I opened a issue to code-gen lib: pagopa/openapi-codegen-ts#269

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@jacopocarlini jacopocarlini marked this pull request as draft January 20, 2022 17:06
@jacopocarlini jacopocarlini marked this pull request as ready for review January 20, 2022 17:09
@jacopocarlini jacopocarlini added the bug Something isn't working label Jan 21, 2022
@jacopocarlini jacopocarlini self-assigned this Jan 21, 2022
@@ -16,8 +16,8 @@
"pretest": "npm-run-all envconfig",
"test": "jest --coverage --ci --testResultsProcessor jest-sonar-reporter",
"test:local": "jest --coverage --ci",
"generate:api": "rm -f swagger.json && wget https://raw.githubusercontent.com/pagopa/pagopa-api-config/main/openapi/swagger.json && sed -i 's/\\\\/\\\\\\\\/g' swagger.json && gen-api-models --api-spec swagger.json --no-strict --out-dir generated/api --request-types --response-decoders --client",
"macosx:generate:api": "rm -f swagger.json && wget https://raw.githubusercontent.com/pagopa/pagopa-api-config/main/openapi/swagger.json && sed -i '' 's/\\\\/\\\\\\\\/g' swagger.json && gen-api-models --api-spec swagger.json --no-strict --out-dir generated/api --request-types --response-decoders --client",
"generate:api": "rm -f swagger.json && wget https://raw.githubusercontent.com/pagopa/pagopa-api-config/main/openapi/swagger.json && sed -i 's/\\\\/\\\\\\\\/g' swagger.json && python3 ./convert.py && gen-api-models --api-spec swagger.json --no-strict --out-dir generated/api --request-types --response-decoders --client",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this is the better solution to deploy now ok.
But 2 things :

  • link issue in to PR desc
  • we'd create a task in a story debito tecnico to put there . As place for all things to see asap

@jacopocarlini jacopocarlini merged commit a75e304 into main Jan 24, 2022
@jacopocarlini jacopocarlini deleted the fix-codegen branch January 24, 2022 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants