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

Open
burnash opened this issue Sep 25, 2024 · 0 comments
Open
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 burnash added the enhancement New feature or request label Sep 25, 2024
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: Todo
Development

No branches or pull requests

1 participant