Skip to content

Cannot take allOf a non-object #674

Closed
@ahuang11

Description

@ahuang11

Describe the bug

Thanks for creating this; I love how explicit it is on errors and warnings!

I am currently encountering this warning:

WARNING parsing POST /2.1/jobs/create within default. Endpoint will not be generated.

Cannot take allOf a non-object

Raised from here. However, I don't fully understand this error, specifically what is a non-object.

Here is the contents that it warns on:

  /2.1/jobs/create:
  ...
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/JobSettings'
                - $ref: '#/components/schemas/AccessControlList'

I double checked to make sure these reference schemas exist:

    JobSettings:
      properties:
        name:
          type: string
          example: A multitask job
...
    AccessControlList:
      type: object
      properties:
        access_control_list:
          type: array
          description: List of permissions to set on the job.
          items:
            $ref: '#/components/schemas/AccessControlRequest'

Any thoughts and suggestions appreciated!

To Reproduce
Steps to reproduce the behavior:

  1. wget https://docs.databricks.com/_static/api-refs/jobs-2.1-aws.yaml
  2. Try running openapi-python-client generate --path jobs-2.1-aws.yaml which results in multiple errors similar to:
components -> schemas -> GitSource -> properties -> git_url -> required
  value is not a valid list (type=type_error.list)
  1. Manually update the offenders' required from bool to list, e.g.
required: false

to

required:
  - false
  1. Rerun openapi-python-client generate --path jobs-2.1-aws.yaml
  2. Results in multiple warnings:

WARNING parsing POST /2.1/jobs/create within default. Endpoint will not be generated.

Cannot take allOf a non-object


WARNING parsing POST /2.1/jobs/run-now within default. Endpoint will not be generated.

Cannot take allOf a non-object

Expected behavior
A clear and concise description of what you expected to happen.

No warnings; succesful generation. I am happy to help contribute a PR if this is indeed a bug and if we can figure out the issue.

OpenAPI Spec File
A link to your openapi.json which produces this issue.
https://docs.databricks.com/_static/api-refs/jobs-2.1-aws.yaml (needs manual modification to the yaml to make it more compliant)

Desktop (please complete the following information):

  • OS: Mac M1
  • Python Version: 3.9.13
  • openapi-python-client version 0.11.6

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐞bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions