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

rest_api: Suggest renaming resolve to reference in dependent resources #1873

Closed
burnash opened this issue Sep 25, 2024 · 1 comment
Closed
Labels
enhancement New feature or request

Comments

@burnash
Copy link
Collaborator

burnash commented Sep 25, 2024

Background

In the current rest_api source configuration, the "resolve" keyword is used to link resources and fields across endpoints:

{
    "client": {
        # ...
    },
    "resources": [
        {
            "name": "issues",
            "endpoint": {
                "path": "issues",
                "params": {
                    "since": {
                        "type": "incremental",
                        "cursor_path": "updated_at",
                        "initial_value": "2024-01-25T11:21:28Z",
                    },
                },
            },
        },
        {
            "name": "issue_comments",
            "endpoint": {
                "path": "issues/{issue_number}/comments",
                "params": {
                    "issue_number": {
                        "type": "resolve",                               # <-- This
                        "resource": "issues",
                        "field": "number",
                    }
                },
            },
        },
    ],
}

Proposal

I suggest renaming "resolve" to "reference" for improved clarity and better alignment with its function:

{
    "client": {
        # ...
    },
    "resources": [
        {
            "name": "issues",
            "endpoint": {
                "path": "issues",
                "params": {
                    "since": {
                        "type": "incremental",
                        "cursor_path": "updated_at",
                        "initial_value": "2024-01-25T11:21:28Z",
                    },
                },
            },
        },
        {
            "name": "issue_comments",
            "endpoint": {
                "path": "issues/{issue_number}/comments",
                "params": {
                    "issue_number": {
                        "type": "reference",                               # <-- To this
                        "resource": "issues",
                        "field": "number",
                    }
                },
            },
        },
    ],
}
@burnash
Copy link
Collaborator Author

burnash commented Feb 18, 2025

This is no longer relevant as we're planning to migrate to a different syntax: #2190

@burnash burnash closed this as completed Feb 18, 2025
@github-project-automation github-project-automation bot moved this from Todo to Done in dlt core library Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

No branches or pull requests

1 participant