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

node.js: leading slash in the path argument of rest-style api #460

Merged
merged 10 commits into from
Oct 10, 2023

Conversation

etimr
Copy link
Contributor

@etimr etimr commented Sep 29, 2023

No description provided.

@@ -1125,7 +1125,7 @@ srv.patch('/Books',...) --> srv.send('PATCH','/Books',...)
srv.delete('/Books',...) --> srv.send('DELETE','/Books',...)
```

You can also use them as REST-style variants to run queries by omitting the leading slash in the `path` argument, or by passing a reflected entity definition instead. In that case they start constructing *bound* [`cds.ql` query objects](cds-ql), as their [CRUD-style counterparts](#crud-style-api):
Leading slash in the `path` argument results in the same behaviour as in `srv.send()`: `path` is sent to a service unmodified. But you can also use these methods as REST-style variants to run queries by omitting the leading slash in the `path` argument, or by passing a reflected entity definition instead. In that case they start constructing *bound* [`cds.ql` query objects](cds-ql), as their [CRUD-style counterparts](#crud-style-api):
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this paragraph is overly complex. Maybe we can simplify but I don't have a good idea atm....

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@johannes-vogel could you please check the simplified variant?

Co-authored-by: Johannes Vogel <[email protected]>
node.js/core-services.md Outdated Show resolved Hide resolved
node.js/core-services.md Outdated Show resolved Hide resolved
node.js/core-services.md Outdated Show resolved Hide resolved
etimr and others added 3 commits October 10, 2023 10:24
Co-authored-by: René Jeglinsky <[email protected]>
Co-authored-by: René Jeglinsky <[email protected]>
Co-authored-by: René Jeglinsky <[email protected]>
@renejeglinsky renejeglinsky merged commit 86d5cdb into main Oct 10, 2023
4 checks passed
@renejeglinsky renejeglinsky deleted the node-rest-style-api branch October 10, 2023 08:33
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.

4 participants