Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Cannot filter persons using an array of organizations as filter #36

Open
tschaffter opened this issue Dec 17, 2020 · 1 comment
Open

Comments

@tschaffter
Copy link
Member

The schema of the filter:

type: object
description: An object that describes how to filter Persons
properties:
  firstName:
    description: Keep the persons whose first name starts with this term
    type: string
  lastName:
    description: Keep the persons whose last name starts with this term
    type: string
  email:
    description: Keep the persons whose email matches this term
    type: string
  organizations:
    description: Keep the persons who belong to these organizations
    type: array
    items:
      $ref: OrganizationId.yaml

The example filter generated by the documentation UI of the server:

{
  "email": "string",
  "firstName": "string",
  "lastName": "string",
  "organizations": [
    "awesome-organization"
  ]
}

The error returned by the server when using this filter:

{
  "detail": "'awesome-organization' is not of type 'array'\n\nFailed validating 'type' in schema['properties']['organizations']:\n    {'description': 'Keep the persons who belong to these organizations',\n     'items': {'description': 'The ID of the organization',\n               'example': 'awesome-organization',\n               'maxLength': 60,\n               'minLength': 3,\n               'pattern': '^[a-z0-9]+(?:-[a-z0-9]+)*$',\n               'type': 'string',\n               'x-scope': ['', '#/components/schemas/PersonFilter']},\n     'type': 'array'}\n\nOn instance['organizations']:\n    'awesome-organization'",
  "status": 400,
  "title": "Bad Request",
  "type": "about:blank"
}
@tschaffter tschaffter added the bug Something isn't working label Dec 17, 2020
@tschaffter tschaffter added this to Incoming in ROCC - Sprint 20.12 - List Challenges via automation Dec 17, 2020
@tschaffter
Copy link
Member Author

For the sake of tomorrow's demo I'll change the filter to accept a string (one organization).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working Priority: Low
Projects
No open projects
Development

No branches or pull requests

1 participant