cog icon indicating copy to clipboard operation
cog copied to clipboard

experiment: support List[str] as an input type

Open zeke opened this issue 3 years ago • 1 comments

Nothing to see here yet. This is an experiment Inspired by https://github.com/replicate/cog/issues/527

zeke avatar Apr 11 '22 17:04 zeke

Using List[str] as an input type annotation appears to produce a correct-looking OpenAPI schema:

{
  "Input": {
    "title": "Input",
    "required": [
      "fruits"
    ],
    "type": "object",
    "properties": {
      "fruits": {
        "title": "Fruits",
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "array of fruit strings",
        "x-order": 0
      }
    }
  }
}

but cog build fails with this error:

ⅹ Failed to get type signature: invalid character 'I' looking for beginning of value

zeke avatar Apr 11 '22 17:04 zeke