github / rest-api-description

An OpenAPI description for GitHub's REST API
MIT License
1.41k stars 231 forks source link

[Schema Inaccuracy] List organization repositories sorting #3445

Open dmmatson opened 8 months ago

dmmatson commented 8 months ago

Schema Inaccuracy

List organization repositories get "/organizations/:organization_id/repos"

Expected

There are two issues with this description...

1.

      description: The property to sort the results by.
        in: query
        required: false
        schema:
          type: string
          enum:
          - created
          - updated
          - pushed
          - full_name
          default: created

We also support sorting by name. [code]

2.

    - name: direction
        description: 'The order to sort by. Default: `asc` when using `full_name`,
          otherwise `desc`.'
        in: query
        required: false
        schema:
          type: string
          enum:
          - asc
          - desc

The fields that sort in ASC order are full_name, id, and name. [code]

Reproduction Steps

GH_DEBUG=1 gh api -X GET --jq ".[].name" "https://api.github.com/orgs/github/repos?sort=name&per_page=100"

dmmatson commented 8 months ago

I don't believe there is any behavioral difference between sorting by full_name vs. name since in the context of an organization the prefix will always be the same, e.g. github/REPO.