cog
cog copied to clipboard
Add ordering to output objects
Inputs are ordered, but outputs are not.
https://github.com/zeke/cog-haiku/pull/12
The order is still intact in Cog's OpenAPI schema:
But not in the schema (nor the prediction object) in replicate-web, which looks to be alphabetical:
In replicate-web, the order of the outputs in the properties is reversed:
postgres=# select openapi_schema->'components'->'schemas'->'Output'->'properties' from models_version where docker_image_id='9d45ce800c36226fa0190021cc70ce6bbb64dce6ff71c70eb2acf11c45fd2635';
?column?
-------------------------------------------------------------------------------------------------------------------------------------------------------------
{"seed": {"type": "integer", "title": "Seed"}, "text": {"type": "string", "title": "Text"}, "image": {"type": "string", "title": "Image", "format": "uri"}}
(1 row)
I think we need to solve this by adding x-order properties to each output object, like we do for Input in Cog.
Related: https://github.com/go-openapi/spec/issues/24
@chenxwh ran into this again today.