typescript client generation wip

This commit is contained in:
timurgordon
2025-01-24 04:31:49 +01:00
parent b9b21ac44b
commit ee8fbbca09
7 changed files with 544 additions and 53 deletions

View File

@@ -76,8 +76,32 @@ const actor_spec = specification.ActorSpecification{
]
},
specification.ActorMethod{
name: 'createPet'
name: 'newPet'
summary: 'Create a new pet'
parameters: [
openrpc.ContentDescriptor{
name: 'result'
description: 'The response of the operation.'
required: true
schema: jsonschema.SchemaRef(jsonschema.Schema{
id: 'pet'
title: 'Pet'
typ: 'object'
properties: {
'id': jsonschema.SchemaRef(jsonschema.Reference{
ref: '#/components/schemas/PetId'
}),
'name': jsonschema.SchemaRef(jsonschema.Schema{
typ: 'string'
}),
'tag': jsonschema.SchemaRef(jsonschema.Schema{
typ: 'string'
})
}
required: ['id', 'name']
})
}
]
example: openrpc.ExamplePairing{
result: openrpc.ExampleRef(openrpc.Example{
name: 'Example response'
@@ -85,9 +109,14 @@ const actor_spec = specification.ActorSpecification{
})
}
result: openrpc.ContentDescriptor{
name: 'result'
description: 'The response of the operation.'
name: 'petId'
summary: 'ID of the created pet'
description: 'ID of the created pet'
required: true
schema: jsonschema.SchemaRef(jsonschema.Schema{
...jsonschema.schema_u32,
example: 1
})
}
errors: [
openrpc.ErrorSpec{