-
Notifications
You must be signed in to change notification settings - Fork 539
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
feat(BE): Export route from OpenAPI Specification3.0 #1245
Conversation
3093f3c
to
7c3b149
Compare
Codecov Report
@@ Coverage Diff @@
## master #1245 +/- ##
==========================================
+ Coverage 62.75% 62.85% +0.10%
==========================================
Files 41 43 +2
Lines 2360 2660 +300
==========================================
+ Hits 1481 1672 +191
- Misses 703 783 +80
- Partials 176 205 +29
Continue to review full report at Codecov.
|
74ab4c5
to
0d191cb
Compare
Hi, @Jaycean. Need unit test. |
At present, the function interface needs to export the existing route data and ensure the correctness of the exported data, so I think E2E should be written more perfectly. I think if the simple unit test only tests whether the interface can export data, it does not represent whether the function of the interface is correct, and if the relevant route data is not created, the interface will not work normally use. |
Not agree with you.
We can mock data in etcd. |
Thank you for your advice. I also think unit testing is really necessary. I just thought that this interface test is almost the same as E2E, but unit testing should cover all situations as much as possible |
a5d09d1
to
7668938
Compare
62cf091
to
b0b3c36
Compare
@liuxiran @nic-chen
|
return &swagger, nil | ||
} | ||
|
||
func parseLabels(route *entity.Route, serviceLabels map[string]string, labels map[string]string) (map[string]string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the label args use for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When service and route have labels at the same time, use route's label. When route has no label, service sometimes uses service's label. This function is used to process this logic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I didn't see the lables args was used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't quite understand your question. Do you mean you don't see users or business scenarios using this field? I don't know if my understanding is correct, because more coverage possibilities are considered everywhere to ensure that the data is not lost. After discussing with nic-chen, this processing function is added.
After communicating with @Jaycean and @nic-chen there are two alternative solutions:
Neither scheme is perfect though, which one do you perfer? any suggestions are welcome, thanks a lot |
because it's using |
I vote for option A, at least it can be imported and exported normally on APISIX platform. |
not sure how other platforms would resolve those issues, we should have a search. |
In my opinion, from the perspective of apimix platform, I choose scheme a to satisfy the users of apimix platform A. The function that URI can be renamed is more open and friendly for users. |
I tried Aliyun API Gateway and eolinker( a API management platform):
As most people choose option A, let's solve the problem with A first, after this feature megerd and released, let's wait for more users feedback ^_^ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this pr has covers all the requirements according to #825
wow, Congratulations this PR was merged |
Please answer these questions before submitting a pull request
Why submit this pull request?
Bugfix
New feature provided
Improve performance
Backport patches
Related issues
[Proposal]: Import & Export route from OpenAPI Specification3.0 #825
New feature or improvement
Related FE PR: #1240