Skip to content

client generation fails on a schema of type "string" #201

@etrottier

Description

@etrottier

the BigQuery API had a discovery doc which contained the following (more or less):

{
  "schemas": {
    "JobReference": {
      "id": "JobReference",
      "type": "object",
      "properties": {
        "location": {
          "$ref": "Location"
        }
      }
    },
    "Location": {
      "id": "Location",
      "type": "string"
    }
  }
}

and it seems that apitools doesn't like a schema that's just a string:

Traceback (most recent call last):
  File "apitools/gen/gen_client.py", line 347, in main
    return args.func(args) or 0
  File "apitools/gen/gen_client.py", line 160, in GenerateClient
    codegen = _GetCodegenFromFlags(args)
  File "apitools/gen/gen_client.py", line 105, in _GetCodegenFromFlags
    apitools_version=args.apitools_version)
  File "apitools/gen/gen_client_lib.py", line 95, in __init__
    schema_name, schema)
  File "apitools/gen/message_registry.py", line 266, in AddDescriptorFromSchema
    schema.get('type'))
ValueError: ('Cannot create message descriptors for type %s', u'string')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions