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

Escape typeprefix #952

Merged
merged 2 commits into from
Jul 15, 2020
Merged

Conversation

cuminandpaprika
Copy link
Contributor

Fixes the escaping of special chars which was previously causing syntax errors.

e.g the following OpenAPI input would produce invalid Sysl due to special characters not being escaped

 /withHeaders:andSpecialChars:
    get:
      responses:
        200:
          description: "200 OK"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SimpleObj"
        404:
          description: "Not Found"
          headers:
            content-type:
              type: string
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"

Changes proposed in this pull request:

  • Add escaping of special characters in the OpenAPI3 importer, when responses have a header field defined
  • Add updating of importer test files to make golden target

Checklist:

  • Added related tests
  • Made corresponding changes to the documentation

@codecov
Copy link

codecov bot commented Jul 15, 2020

Codecov Report

Merging #952 into master will increase coverage by 0.78%.
The diff coverage is 83.88%.

@@            Coverage Diff             @@
##           master     #952      +/-   ##
==========================================
+ Coverage   83.35%   84.14%   +0.78%     
==========================================
  Files          73       74       +1     
  Lines       10609    10309     -300     
==========================================
- Hits         8843     8674     -169     
+ Misses       1432     1322     -110     
+ Partials      334      313      -21     
Impacted Files Coverage Δ
pkg/pbutil/output.go 76.00% <ø> (-0.48%) ⬇️
pkg/syslwrapper/test_helper.go 57.89% <ø> (-1.42%) ⬇️
pkg/parse/listener_impl.go 89.50% <61.53%> (+<0.01%) ⬆️
pkg/importer/importer.go 63.15% <63.15%> (ø)
pkg/mod/gomod.go 73.68% <66.66%> (+1.27%) ⬆️
pkg/parse/parse.go 83.47% <69.56%> (-0.50%) ⬇️
pkg/mod/module.go 66.66% <72.72%> (+0.95%) ⬆️
pkg/importer/formats.go 77.27% <77.27%> (ø)
pkg/importer/openapi.go 81.73% <80.71%> (-7.72%) ⬇️
pkg/importer/swagger.go 81.48% <88.88%> (+1.88%) ⬆️
... and 16 more

Copy link
Contributor

@andrewemeryanz andrewemeryanz left a comment

Choose a reason for hiding this comment

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

Good.

@cuminandpaprika cuminandpaprika merged commit 8d4784d into anz-bank:master Jul 15, 2020
@cuminandpaprika cuminandpaprika deleted the escape-typeprefix branch July 15, 2020 04:29
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

Successfully merging this pull request may close these issues.

2 participants