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

API element resources - nested elements #5626

Conversation

AntonKhorev
Copy link
Collaborator

@AntonKhorev AntonKhorev commented Feb 6, 2025

Creates nested resources instead of the following actions: ways_for_node, relations_for_node, relations_for_way, relations_for_relation. After that there's no nonstandard actions in api element controllers for current versions of elements.

The current structure is a bit surprising too. Here's a route to get ways that include a given node for example:

get "node/:id/ways" => "ways#ways_for_node"

As you can see the action is not defined in the nodes controller, rather it's in the ways controller. The ways controller receives an id param that's not an id of a way. In this PR I'm adding another controller for ways that include a node, and three more controllers for relations that contain a node/way/relation.

@github-actions github-actions bot added the big-pr label Feb 6, 2025
Copy link

github-actions bot commented Feb 6, 2025

1 Warning
⚠️ Number of updated lines of code is too large to be in one PR. Perhaps it should be separated into two or more?

Generated by 🚫 Danger

@AntonKhorev AntonKhorev force-pushed the api-element-resources--nested-elements branch from eb1ae8e to 7efcfa2 Compare February 8, 2025 15:23
@tomhughes
Copy link
Member

Looks good to me, thanks.

@tomhughes tomhughes merged commit 699e73a into openstreetmap:master Feb 9, 2025
22 checks passed
@AntonKhorev AntonKhorev deleted the api-element-resources--nested-elements branch February 9, 2025 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants