Skip to content

feat: standardize method naming conventions in API Classes #246

@luboszima

Description

@luboszima

Is your feature request related to a problem? Please describe.

feat/chore

Describe the solution you'd like

While working with the synology_api/docker_api.py class, I noticed that many methods are named with different conventions, and there is no consistent terminology or naming standard throughout the class.

See my original comment: #241 (comment)

This feature aims to establish a standard for method naming in our API classes and ensure backward compatibility with existing method names.

Additional context

I suggest using a format like:

<api_method>_<api_area>()

Where api_method refers to the WebAPI method (e.g., list, get, stats), and api_area is a formatted API name. For example:

$ echo "SYNO.Docker.Image" | sed 's/SYNO.//' | tr '.' '_' | tr '[:upper:]' '[:lower:]'
docker_image

Note: if api_method is list or some get which returns multiple elements/data we can add plural s behind api_area

TODO

  • Our classes use standardized naming
  • We maintain backward compatibility
  • Optional: Add a GitHub Actions workflow to test the naming convention

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions