anz-bank / sysl

Sysl (pronounced "sizzle") is a system specification language
https://sysl.io
Apache License 2.0
122 stars 42 forks source link

Changed rules to match new http_path like `/rest?method=flickr%2Ephotos%2Esearch` #950

Closed ericzhang6222 closed 4 years ago

ericzhang6222 commented 4 years ago

Fixes #945 .

Changes proposed in this pull request:

Checklist:

codecov[bot] commented 4 years ago

Codecov Report

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

@@            Coverage Diff             @@
##           master     #950      +/-   ##
==========================================
+ 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%) :arrow_down:
pkg/syslwrapper/test_helper.go 57.89% <ø> (-1.42%) :arrow_down:
pkg/parse/listener_impl.go 89.50% <61.53%> (+<0.01%) :arrow_up:
pkg/importer/importer.go 63.15% <63.15%> (ø)
pkg/mod/gomod.go 73.68% <66.66%> (+1.27%) :arrow_up:
pkg/parse/parse.go 83.47% <69.56%> (-0.50%) :arrow_down:
pkg/mod/module.go 66.66% <72.72%> (+0.95%) :arrow_up:
pkg/importer/formats.go 77.27% <77.27%> (ø)
pkg/importer/openapi.go 81.73% <80.71%> (-7.72%) :arrow_down:
pkg/importer/swagger.go 81.48% <88.88%> (+1.88%) :arrow_up:
... and 16 more
ericzhang6222 commented 4 years ago

Are there any changes required in swagger importer to handle the change in the sysl parser? Currently query params are split. /rest?method=flickr%2Ephotos%2Esearch: GET ?api_key=string&text=string?

It can be changed in swagger importer side instead. But as definition http_path_static: http_path_part in pkg/grammar/SyslParser.g4, /rest?method=flickr%2Ephotos%2Esearch is static path and it is variable + variable value. It is different from GET ?api_key=string&text=string? which is variable + variable data type. So I changed Sysl parsing.

ericzhang6222 commented 4 years ago

@marcelocantos, can you help to review too? I changed Sysl parser rules.