mirror of
https://github.com/hanzo-ml/kserve.git
synced 2026-10-30 20:53:49 +00:00
* Add support for response in OpenAPI * Add unit tests for responses * Update E2E tests for responses * Cleanup * Add panic for unexpected error * Encapsulate req + resp schemas * Update tests for new Schema params and templatize * Rm newline
76 lines
1.8 KiB
JSON
76 lines
1.8 KiB
JSON
{
|
|
"components": {
|
|
"requestBodies": {
|
|
"modelInput": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"instances": {
|
|
"items": {
|
|
"items": {
|
|
"type": "number"
|
|
},
|
|
"maxItems": 4,
|
|
"minItems": 4,
|
|
"type": "array"
|
|
},
|
|
"type": "array"
|
|
}
|
|
},
|
|
"required": ["instances"],
|
|
"type": "object"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"modelOutput": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"predictions": {
|
|
"items": {
|
|
"items": {
|
|
"type": "number"
|
|
},
|
|
"maxItems": 2,
|
|
"minItems": 2,
|
|
"type": "array"
|
|
},
|
|
"type": "array"
|
|
}
|
|
},
|
|
"required": ["predictions"],
|
|
"type": "object"
|
|
}
|
|
}
|
|
},
|
|
"description": "Model output"
|
|
}
|
|
}
|
|
},
|
|
"info": {
|
|
"title": "TFServing Predict Request API",
|
|
"version": "1.0"
|
|
},
|
|
"openapi": "3.0.0",
|
|
"paths": {
|
|
"/v1/models/model/versions/1:predict": {
|
|
"post": {
|
|
"requestBody": {
|
|
"$ref": "#/components/requestBodies/modelInput"
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"$ref": "#/components/responses/modelOutput"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |