Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure correct OpenAPI 3.1.0 spec. #646

Merged
merged 30 commits into from
Nov 6, 2024
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
54ffcf8
Added Python and Ruby spec validators.
dblock Oct 25, 2024
92e711e
Add empty descriptions where missing and remove descriptions next to …
dblock Nov 4, 2024
fffaae3
Replaced the validator compatible with OpenAPI 3.1.
dblock Nov 4, 2024
63051b4
Fixed incorrect style.
dblock Nov 4, 2024
2dafa40
Added missing require.
dblock Nov 4, 2024
5736735
Fix: schema null is not supported.
dblock Nov 4, 2024
8c42278
Removed unused required property.
dblock Nov 4, 2024
c0ea5ff
Fix: added missing schema.
dblock Nov 4, 2024
d8ffd3f
Fix: removed incorrect defaults.
dblock Nov 4, 2024
2b63431
Fix: added missing required.
dblock Nov 4, 2024
beb6eeb
Fix: removed incorrect required.
dblock Nov 4, 2024
fc4730c
Removed incorrect externalDocs.
dblock Nov 4, 2024
04716ca
Document the ruby spec validator.
dblock Nov 4, 2024
7bf5b00
Fix: removed redundant content types.
dblock Nov 4, 2024
a4b83f5
Improve displaying of errors.
dblock Nov 4, 2024
6610faa
Normalize keys to be compatible with OpenAPI 3.1.
dblock Nov 4, 2024
5485529
Removed superseeded operations that have unresolved parameters.
dblock Nov 4, 2024
f3759a1
Fix: don't reduce error payload, allows to verify schema.
dblock Nov 5, 2024
732fde0
Fix: flow framework schema tests.
dblock Nov 5, 2024
4abc6be
Fix: if no decision is made there's no weight ranking.
dblock Nov 5, 2024
bc24479
Fix: wrap indexing errors.
dblock Nov 5, 2024
52783ee
Added verbose logging of the story being evaluated.
dblock Nov 5, 2024
635e180
Fix: security API test error responses.
dblock Nov 5, 2024
7b0c299
Fix: duration ref.
dblock Nov 5, 2024
0a15d96
Fix typo in property.
dblock Nov 5, 2024
8e3e4c5
Fix superseeded operation parameters.
dblock Nov 5, 2024
acf7788
Fix: neural search error response.
dblock Nov 5, 2024
50c3258
Normalize fields.
dblock Nov 5, 2024
d1a1bac
Re-added default values into the schema.
dblock Nov 5, 2024
359e6f8
Disallowed characters are replaced with ___.
dblock Nov 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix: flow framework schema tests.
Signed-off-by: dblock <dblock@amazon.com>
dblock committed Nov 5, 2024
commit 732fde003d2ae89ffd79d77449f298f75045a9ed
12 changes: 6 additions & 6 deletions spec/namespaces/flow_framework.yaml
Original file line number Diff line number Diff line change
@@ -403,7 +403,7 @@ components:
content:
application/json:
schema:
oneOf:
anyOf:
- $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/InvalidParameterError'
- $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/ConflictError'
- $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/MissingParameterError'
@@ -419,7 +419,7 @@ components:
content:
application/json:
schema:
oneOf:
anyOf:
- $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/InvalidParameterError'
- $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/ConflictError'
- $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/MissingParameterError'
@@ -478,7 +478,7 @@ components:
content:
application/json:
schema:
$ref: '../schemas/flow_framework.common.yaml#/components/schemas/WorkflowStep'
$ref: '../schemas/flow_framework.common.yaml#/components/schemas/WorkflowSteps'
flow_framework.get_steps@403:
description: Flow Framework API Disabled Error
content:
@@ -504,19 +504,19 @@ components:
content:
application/json:
schema:
oneOf:
anyOf:
- $ref: '../schemas/flow_framework.common.yaml#/components/schemas/WorkFlowStatusFullResponse'
- $ref: '../schemas/flow_framework.common.yaml#/components/schemas/WorkFlowStatusDefaultResponse'
flow_framework.deprovision@200:
content:
application/json:
schema:
$ref: '../schemas/flow_framework.common.yaml#/components/schemas/WorkflowID'
$ref: '../schemas/flow_framework.common.yaml#/components/schemas/WorkflowIDResponse'
flow_framework.provision@200:
content:
application/json:
schema:
$ref: '../schemas/flow_framework.common.yaml#/components/schemas/WorkflowID'
$ref: '../schemas/flow_framework.common.yaml#/components/schemas/WorkflowIDResponse'
flow_framework.deprovision@202:
content:
application/json:
3 changes: 1 addition & 2 deletions spec/namespaces/observability.yaml
Original file line number Diff line number Diff line change
@@ -150,7 +150,6 @@ components:
type: object
additionalProperties:
type: string
example: OK
observability.delete_object@404:
description: Not Found
content:
@@ -168,7 +167,7 @@ components:
type: object
additionalProperties:
type: string
example: OK
# example: OK
observability.delete_objects@404:
description: Not Found
content:
36 changes: 30 additions & 6 deletions spec/schemas/flow_framework.common.yaml
Original file line number Diff line number Diff line change
@@ -11,6 +11,12 @@ components:
type: string
WorkflowID:
type: string
WorkFlowIDResponse:
type: object
properties:
workflow_id:
type: string
description: The ID of the workflow
WorkflowStepName:
type: string
Provision:
@@ -99,6 +105,8 @@ components:
properties:
name:
type: string
version:
$ref: '#/components/schemas/version'
description:
type: string
use_case:
@@ -111,6 +119,8 @@ components:
type: integer
last_updated_time:
type: integer
last_provisioned_time:
type: number
version:
type: object
description: A key-value map with two fields, template, which identifies the template version, and compatibility, which identifies a list of minimum required OpenSearch versions.
@@ -135,6 +145,9 @@ components:
failed:
type: integer
description: The number of shards where the deletion failed.
skipped:
type: integer
description: The number of shards where the deletion was skipped.
query:
type: object
description: The search query to match workflows. Use `match_all` to retrieve all workflows, or `match` to search by specific fields like `use_case`.
@@ -237,9 +250,11 @@ components:
total:
$ref: '#/components/schemas/total'
max_score:
type: number
format: float
description: The maximum score of the search hits.
oneOf:
- type: 'null'
- type: number
format: float
description: The maximum score of the search hits.
hits:
type: array
items:
@@ -250,13 +265,19 @@ components:
total:
$ref: '#/components/schemas/total'
max_score:
type: number
format: float
description: The maximum score of the search hits.
oneOf:
- type: 'null'
- type: number
format: float
description: The maximum score of the search hits.
hits:
type: array
items:
$ref: '#/components/schemas/StateItems'
WorkflowSteps:
type: object
additionalProperties:
$ref: '#/components/schemas/WorkflowStep'
WorkflowStep:
type: object
properties:
@@ -275,6 +296,9 @@ components:
items:
type: string
description: The list of plugins required for the workflow step
timeout:
type:
$ref: '../schemas/_common.yaml#/components/schemas/Duration'
WorkFlowStatusDefaultResponse:
type: object
properties:
44 changes: 22 additions & 22 deletions spec/schemas/flow_framework.errors.yaml
Original file line number Diff line number Diff line change
@@ -11,47 +11,47 @@ components:
properties:
error:
type: string
example: This API is disabled. To enable it, set [flow_framework.enabled] to true.
# example: This API is disabled. To enable it, set [flow_framework.enabled] to true.
status:
type: integer
InvalidParameterError:
type: object
properties:
error:
type: string
example: Only the parameters [param1, param2] are permitted unless the provision parameter is set to true.
# example: Only the parameters [param1, param2] are permitted unless the provision parameter is set to true.
status:
type: integer
ConflictError:
type: object
properties:
error:
type: string
example: You cannot use both the 'provision_workflow' and 'update_workflow_fields' parameters in the same request.
# example: You cannot use both the 'provision_workflow' and 'update_workflow_fields' parameters in the same request.
status:
type: integer
MissingParameterError:
type: object
properties:
error:
type: string
example: You cannot use the 'reprovision_workflow' parameter to create a new template.
# example: You cannot use the 'reprovision_workflow' parameter to create a new template.
status:
type: integer
ParameterConflictError:
type: object
properties:
error:
type: string
example: You cannot use the 'reprovision_workflow' and 'use_case' parameters in the same request.
# example: You cannot use the 'reprovision_workflow' and 'use_case' parameters in the same request.
status:
type: integer
WorkFlowIdNullError:
type: object
properties:
error:
type: string
example: Workflow ID can not be null
# example: Workflow ID can not be null
status:
type: integer
DuplicateKeyError:
@@ -63,7 +63,7 @@ components:
status:
type: integer
description: HTTP status code for the error.
example: 400
# example: 400
InvalidRequestBodyFieldError:
type: object
properties:
@@ -82,21 +82,21 @@ components:
status:
type: integer
description: HTTP status code for the error.
example: 400
# example: 400
WorkflowSaveError:
type: object
properties:
error:
type: string
example: Failed to save workflow state
status:
type: integer
# example: Failed to save workflow state
status:
type: integer
MaxWorkflowsLimitError:
type: object
properties:
error:
type: string
example: Maximum workflows limit reached 50
# example: Maximum workflows limit reached 50
code:
type: integer
TemplateNameRequiredError:
@@ -110,7 +110,7 @@ components:
properties:
error:
type: string
example: Failed to retrieve template (12345) from global context.
# example: Failed to retrieve template (12345) from global context.
code:
type: integer
InvalidTemplateVersionError:
@@ -119,27 +119,27 @@ components:
error:
type: string
description: Error message when the template version is invalid or missing.
example: Unable to parse field [version] in a version object.
# example: Unable to parse field [version] in a version object.
UnsupportedFieldUpdateError:
type: object
properties:
error:
type: string
description: Error message when trying to update an unsupported field in a template.
example: You can not update the field [fieldName] without updating the whole template.
# example: You can not update the field [fieldName] without updating the whole template.
WorkflowParsingError:
type: object
properties:
error:
type: string
description: Error message when workflow parsing fails.
example: Unable to parse field [workflow] in a template object.
# example: Unable to parse field [workflow] in a template object.
WorkflowStepsRetrieveError:
type: object
properties:
error:
type: string
example: Failed to retrieve workflow step json.
# example: Failed to retrieve workflow step json.
code:
type: integer
DeprovisioningError:
@@ -148,7 +148,7 @@ components:
error:
type: string
description: Describes the deprovisioning error and identifies resources that were not deprovisioned
example: Failed to deprovision some resources [connector_id Lw7PX4wBfVtHp98y06wV].
# example: Failed to deprovision some resources [connector_id Lw7PX4wBfVtHp98y06wV].
required:
- error
DeprovisioningForbiddenError:
@@ -157,7 +157,7 @@ components:
error:
type: string
description: Describes the resources that require the allow_delete parameter for deprovisioning
example: These resources require the allow_delete parameter to deprovision [index_name my-index].
# example: These resources require the allow_delete parameter to deprovision [index_name my-index].
required:
- error
RequestTimeoutError:
@@ -169,15 +169,15 @@ components:
status:
type: integer
description: HTTP status code for the error.
example: 408
# example: 408
BadRequestError:
type: object
properties:
error:
type: string
description: Error message when the request body or parameters are invalid.
example: Invalid request body or query parameters.
# example: Invalid request body or query parameters.
status:
type: integer
description: HTTP status code for the error.
example: 400
# example: 400
10 changes: 5 additions & 5 deletions spec/schemas/observability._common.yaml
Original file line number Diff line number Diff line change
@@ -218,7 +218,7 @@ components:
$ref: '#/components/schemas/ErrorResponse'
status:
type: integer
example: 404
# example: 404
required:
- error
- status
@@ -232,10 +232,10 @@ components:
$ref: '#/components/schemas/RootCause'
type:
type: string
example: status_exception
# example: status_exception
reason:
type: string
example: 'ObservabilityObject {objectId} not found'
# example: 'ObservabilityObject {objectId} not found'
required:
- reason
- root_cause
@@ -246,10 +246,10 @@ components:
properties:
type:
type: string
example: status_exception
# example: status_exception
reason:
type: string
example: 'ObservabilityObject {objectId} not found'
# example: 'ObservabilityObject {objectId} not found'
required:
- reason
- type
2 changes: 2 additions & 0 deletions tests/default/flow_framework/template.yaml
Original file line number Diff line number Diff line change
@@ -7,6 +7,8 @@ epilogues:
status: [200, 404]
parameters:
workflow_id: ${create_flow_framework.test_workflow_id}
warnings:
multiple-paths-detected: false
chapters:
- synopsis: Create workflow with openAI model.
id: create_flow_framework