feat: complete SaaS commercial delivery workflows
This commit is contained in:
@@ -29,6 +29,7 @@ export function normalizeOperationInput(operation: PlatformOperation, values: Op
|
||||
export function OperationForm({ operation }: { operation: PlatformOperation }) {
|
||||
const pathParameters = operation.parameters.filter((item) => item.in === 'path');
|
||||
const queryParameters = operation.parameters.filter((item) => item.in === 'query');
|
||||
const headerParameters = operation.parameters.filter((item) => item.in === 'header');
|
||||
const bodySchema = resolveSchema(operation.requestSchema);
|
||||
return (
|
||||
<>
|
||||
@@ -53,6 +54,17 @@ export function OperationForm({ operation }: { operation: PlatformOperation }) {
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{headerParameters.map((parameter) => (
|
||||
<Form.Item
|
||||
key={`header-${parameter.name}`}
|
||||
name={['headers', parameter.name]}
|
||||
label={parameter.description || parameter.name}
|
||||
rules={[{ required: parameter.required, message: `请填写${parameter.description || parameter.name}` }]}
|
||||
initialValue={parameter.name.toLowerCase() === 'idempotency-key' ? crypto.randomUUID() : undefined}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
))}
|
||||
{operation.requestSchema && schemaType(bodySchema) === 'object' && (
|
||||
<SchemaFields schema={bodySchema} prefix="body" required={bodySchema.required} />
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user