-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat(rest): add mountExpressRouter #2643
Conversation
82d2b4a
to
c749427
Compare
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.
Nice progress.
packages/rest/src/__tests__/integration/rest.application.integration.ts
Outdated
Show resolved
Hide resolved
packages/rest/src/__tests__/integration/rest.application.integration.ts
Outdated
Show resolved
Hide resolved
packages/rest/src/__tests__/integration/rest.application.integration.ts
Outdated
Show resolved
Hide resolved
packages/rest/src/__tests__/integration/rest.application.integration.ts
Outdated
Show resolved
Hide resolved
ca85204
to
4decf7b
Compare
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.
Nice!
I see there are few tests that are missing the implementation, other than that I think you are almost done here 👍
Is it perhaps the time to switch from a draft to a regular pull request?
packages/rest/src/__tests__/unit/router/assign-router-spec.unit.ts
Outdated
Show resolved
Hide resolved
4decf7b
to
9a2024e
Compare
9a2024e
to
f47ccc5
Compare
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.
Almost there! Please fix the assertion in the test, other comments can be ignored.
packages/rest/src/__tests__/unit/router/rebase-openapi-spec.unit.ts
Outdated
Show resolved
Hide resolved
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.
great job!
f47ccc5
to
a069321
Compare
7a61cf1
to
93f8841
Compare
}); | ||
|
||
it('mounts an express Router without spec', async () => { | ||
const router = express.Router(); |
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 would the default generated(?) spec look like here if one is not provided? Can we add an assertion for it?
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.
The spec
is optional, so if it isn't provided then it won't get generated or appear in openapi.json
.
res.send('External dog'); | ||
}); | ||
|
||
restApp.static('/dogs', ASSETS); |
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.
Do we silently replace the static route in this case?
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 it's looking for the route, it first checks if there's an external route, then if it can't find it then it uses the static one (see here), so I believe the static one still exists, but is overshadowed by the external one.
packages/rest/src/__tests__/unit/router/rebase-openapi-spec.unit.ts
Outdated
Show resolved
Hide resolved
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.
Mostly nitpicks, LGTM overall 💯.
packages/rest/src/__tests__/unit/router/assign-router-spec.unit.ts
Outdated
Show resolved
Hide resolved
93f8841
to
2937121
Compare
Co-authored-by: Miroslav Bajtoš <mbajtoss@gmail.com>
2937121
to
8714035
Compare
Closes #2389.
Add
mountExpressRouter
toRestApplication
andRestServer
and include inRoutes.md
.Checklist
👉 Read and sign the CLA (Contributor License Agreement) 👈
npm test
passes on your machinepackages/cli
were updatedexamples/*
were updated