Skip to content
This repository was archived by the owner on Jan 15, 2024. It is now read-only.
This repository was archived by the owner on Jan 15, 2024. It is now read-only.

Attributes not being mapped to controller #115

@nesl247

Description

@nesl247

I'm having an issue with the mapping of the request body to the controller action. Currently it's telling me my first parameter is null and thus it can't set it.

For example:

public function __invoke(string $slug, string $type, string $group, bool $private, array $label): Response
parameters:
        - in: body
          name: body
          schema:
            type: object
            properties:
              uuid:
                type: string
                format: uuid
              slug:
                type: string
              private:
                type: boolean
                default: false
              group:
                type: string
              type:
                $ref: '#/definitions/attribute-types'
              label:
                type: object
                description: Label for the attribute visible to the end user.
                required:
                  - global
                properties:
                  global:
                    type: object
                  store:
                    type: object
              validationRules:
                type: array
                items: {}
            required:
              - slug
              - group
              - type
              - label
            example:
              uuid: c02721b3-64d9-400d-b6ae-beb25eab8653
              slug: memory
              private: true
              group: technical
              type: string
              label:
                global:
                  en-US: Memory
                  es-US: Memoria
                store:
                  mx:
                    es-MX: Memoria (RAM)
app.CRITICAL: Internal Server Error [logref 5aa800200ffd0]: RuntimeException: Controller "CreateAttribute" requires that you provide a value for the "$slug" argument. Either the argument is nullable and no null value has been provided, no default value has been provided or because there is a non optional argument after this one.

Am I doing something wrong, or is there a bug?

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