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

All instructions for multiple objects does not have "patch" part in OAS #11358

Closed
3 tasks done
kuzmi4 opened this issue Jan 31, 2022 · 3 comments · Fixed by #19390
Closed
3 tasks done

All instructions for multiple objects does not have "patch" part in OAS #11358

kuzmi4 opened this issue Jan 31, 2022 · 3 comments · Fixed by #19390
Assignees

Comments

@kuzmi4
Copy link

kuzmi4 commented Jan 31, 2022

Preflight Checklist

Describe the Bug

In OAS file missed Update/Delete operations with multiple Items/Files which describe on

To Reproduce

Get OAS from directus and read docs

Errors Shown

All client generator from OAS file doesn`t have methods with multiple files/items

What version of Directus are you using?

9.5.0

What version of Node.js are you using?

17.4.0

What database are you using?

Postgres 13

What browser are you using?

Firefox

What operating system are you using?

Linux 5.4.0-42-generic

How are you deploying Directus?

Kubernetes

@kuzmi4
Copy link
Author

kuzmi4 commented Feb 1, 2022

Maybe problem a bit bigger, all instructions for multiple objects does not have "patch" part. ( https://github.com/directus/directus/tree/main/packages/specs/src/paths )

for e.x. items

get:
  summary: List Items
  description: List the items.
  tags:
    - Items
  operationId: getItems
  security:
    - Auth: []
  parameters:
    - $ref: '../../openapi.yaml#/components/parameters/Fields'
    - $ref: '../../openapi.yaml#/components/parameters/Limit'
    - $ref: '../../openapi.yaml#/components/parameters/Meta'
    - $ref: '../../openapi.yaml#/components/parameters/Offset'

    - $ref: '../../openapi.yaml#/components/parameters/Sort'
    - $ref: '../../openapi.yaml#/components/parameters/Filter'
    - $ref: '../../openapi.yaml#/components/parameters/Search'
  responses:
    '200':
      description: Successful request
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                type: array
                items:
                  type: object
    '401':
      $ref: '../../openapi.yaml#/components/responses/UnauthorizedError'

post:
  summary: Create an Item
  description: Create a new item.
  tags:
    - Items
  operationId: createItem
  parameters:
    - $ref: '../../openapi.yaml#/components/parameters/Meta'
  requestBody:
    content:
      application/json:
        schema:
          type: object
  responses:
    '200':
      description: Successful request
      content:
        application/json:
          schema:
            type: object
    '401':
      $ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
parameters:
  - $ref: '../../openapi.yaml#/components/parameters/Collection'

or permissions

get:
  summary: List Permissions
  description: List all permissions.
  operationId: getPermissions
  parameters:
    - $ref: '../../openapi.yaml#/components/parameters/Fields'
    - $ref: '../../openapi.yaml#/components/parameters/Limit'
    - $ref: '../../openapi.yaml#/components/parameters/Offset'

    - $ref: '../../openapi.yaml#/components/parameters/Meta'
    - $ref: '../../openapi.yaml#/components/parameters/Sort'
    - $ref: '../../openapi.yaml#/components/parameters/Filter'
    - $ref: '../../openapi.yaml#/components/parameters/Search'
    - $ref: '../../openapi.yaml#/components/parameters/Page'
  responses:
    '200':
      description: Successful request
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                type: array
                items:
                  $ref: '../../openapi.yaml#/components/schemas/Permissions'
    '401':
      $ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
    '404':
      $ref: '../../openapi.yaml#/components/responses/NotFoundError'
  tags:
    - Permissions

post:
  summary: Create a Permission
  description: Create a new permission.
  operationId: createPermission
  parameters:
    - $ref: '../../openapi.yaml#/components/parameters/Meta'
  requestBody:
    content:
      application/json:
        schema:
          properties:
            collection:
              description: What collection this permission applies to.
              type: string
              example: customers
            comment:
              description: If the user can post comments.
              type: string
              enum: [none, create, update, full]
            create:
              description: If the user can create items.
              type: string
              enum: [none, full]
            delete:
              description: If the user can update items.
              type: string
              enum: [none, mine, role, full]
            explain:
              description: If the user is required to leave a comment explaining what was changed.
              type: string
              enum: [none, create, update, always]
            read:
              description: If the user can read items.
              type: string
              enum: [none, mine, role, full]
            role:
              description: Unique identifier of the role this permission applies to.
              type: integer
              example: 3
            read_field_blacklist:
              description: Explicitly denies read access for specific fields.
              type: array
              items:
                type: string
              example: ['featured_image']
            status:
              description: What status this permission applies to.
              type: string
            status_blacklist:
              description: Explicitly denies specific statuses to be used.
              type: array
              items:
                type: string
            update:
              description: If the user can update items.
              type: string
              enum: [none, mine, role, full]
            write_field_blacklist:
              description: Explicitly denies write access for specific fields.
              type: array
              items:
                type: string
          type: object
  responses:
    '200':
      description: Successful request
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                $ref: '../../openapi.yaml#/components/schemas/Permissions'
    '401':
      $ref: '../../openapi.yaml#/components/responses/UnauthorizedError'
    '404':
      $ref: '../../openapi.yaml#/components/responses/NotFoundError'
  tags:
    - Permissions

@kuzmi4 kuzmi4 changed the title Missed operations with multiple Items/Files (Delete,Update) in OAS files All instructions for multiple objects does not have "patch" part in OAS Feb 1, 2022
@licitdev
Copy link
Member

licitdev commented Feb 3, 2022

Thank you @kuzmi4 for your report.
Confirmed that the multiple items/files are not in the current specs.

@rijkvanzanten
Copy link
Member

Linear: ENG-274

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants