Commit eb10785
✨ Extend the code generator for Collections by extending their functionality to follow links (#76)
### Description
This change extends the generator for endpoints with a `Get` method that
returns a `Collection` (`x-collection` or SimpleCollection schemas), and
defines two methods for following links for each endpoint, one in the
APIService struct and one in the APIRequest struct.
The generation is based on the same methods that executes a Get request,
the original Execute method is parsed into an AST, copied and modified
to be able to follow links, by adding a link argument, and modifying the
path to follow that argument.
### Test Coverage
The test added only tests generation for the FollowLinks functions as
the testing for `x-redact` in Collections is already part of existing
tests.
- [X] This change is covered by existing or additional automated tests.
- [ ] Manual testing has been performed (and evidence provided) as
automated testing was not feasible.
- [ ] Additional tests are not required for this change (e.g.
documentation update).
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: aorabdel <aorabdel@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Monty Bot <monty-bot@arm.com>
Co-authored-by: Adrien CABARBAYE <adrien.cabarbaye@arm.com>
Co-authored-by: acabarbaye <acabarbaye@users.noreply.github.com>1 parent 6768022 commit eb10785
36 files changed
Lines changed: 11970 additions & 3134 deletions
File tree
- .github/workflows
- changes
- client
- extensions
- generator
- codegen
- templates
- testdata/linkfollowers
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| 98 | + | |
98 | 99 | | |
99 | 100 | | |
100 | 101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
0 commit comments