Skip to content

oneOf generating error for parameters #669

@aurelGabo

Description

@aurelGabo

Jane version(s) affected: 7.3.1

Description
I have a "parameters" component part in a yaml configuration file, where parameters of the endpoints are described.
One of this parameter schema uses oneOf to allow integer or string types. When I try to generate, I have an error which disappear if I change and do not use oneOf. Maybe oneOf is not supported here ?

How to reproduce
The parameter is defined like this :

    'offset':
      'in': 'query'
      'name': 'offset'
      'description': 'The pagination offset'
      'schema':
        'oneOf':
          - 'type': 'integer'
            'minimum': 0
            'example': 25
          - 'type': 'string'
            'example': 'WzIwMTQtMDEtMDEsNTk4XQ=='

and referenced with

   'parameters':
        - '$ref': '#/components/parameters/offset'

If I try to generate, I have this error :
PHP Fatal error: Uncaught TypeError: Return value of Jane\Component\OpenApi3\Generator\Parameter\NonBodyParameterGenerator::convertParameterType() must be of the type array, null returned in /jane-php/open-api-3/Generator/Parameter/NonBodyParameterGenerator.php:198

Is it possible to handle this case ? Thank you very much for your help !

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions