Skip to content

Commit d57dd0e

Browse files
committed
fix: cred def type is constant not object
fixes #57 Signed-off-by: Timo Glastra <timo@animo.id>
1 parent 98ee6d8 commit d57dd0e

File tree

3 files changed

+23
-12
lines changed

3 files changed

+23
-12
lines changed

aries_cloudcontroller/model/credential_definition.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class CredentialDefinition(BaseModel):
2828
id: Optional[str] = None
2929
schema_id: Optional[str] = Field(None, alias="schemaId")
3030
tag: Optional[str] = None
31-
type: Optional[Dict[str, Any]] = None
31+
type: Optional[Literal["CL"]] = None
3232
value: Optional[CredDefValue] = None
3333
ver: Optional[str] = None
3434

@@ -38,7 +38,7 @@ def __init__(
3838
id: Optional[str] = None,
3939
schema_id: Optional[str] = None,
4040
tag: Optional[str] = None,
41-
type: Optional[Dict[str, Any]] = None,
41+
type: Optional[Literal["CL"]] = None,
4242
value: Optional[CredDefValue] = None,
4343
ver: Optional[str] = None,
4444
**kwargs,

generator/data/openapi.patch

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/generator/data/openapi.yml b/generator/data/openapi.yml
2-
index 4582107..54bbbf4 100644
2+
index 4582107..fbc80b8 100644
33
--- a/generator/data/openapi.yml
44
+++ b/generator/data/openapi.yml
55
@@ -705,7 +705,7 @@ paths:
@@ -63,7 +63,17 @@ index 4582107..54bbbf4 100644
6363
created_at:
6464
pattern: ^\d{4}-\d\d-\d\d[T ]\d\d:\d\d(?:\:(?:\d\d(?:\.\d{1,6})?))?(?:[+-]\d\d:?\d\d|Z|)$
6565
type: string
66-
@@ -5021,6 +5007,8 @@ components:
66+
@@ -4979,7 +4965,8 @@ components:
67+
description: Tag within credential definition identifier
68+
example: tag
69+
type:
70+
- type: object
71+
+ enum:
72+
+ - CL
73+
description: 'Signature type: CL for Camenisch-Lysyanskaya'
74+
example: CL
75+
value:
76+
@@ -5021,6 +5008,8 @@ components:
6777
example: default
6878
CredentialDefinitionSendResult:
6979
type: object
@@ -72,7 +82,7 @@ index 4582107..54bbbf4 100644
7282
properties:
7383
credential_definition_id:
7484
pattern: ^([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}):3:CL:(([1-9][0-9]*)|([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}:2:.+:[0-9.]+)):(.+)?$
75-
@@ -7328,6 +7316,8 @@ components:
85+
@@ -7328,6 +7317,8 @@ components:
7686
example: 0
7787
RevRegResult:
7888
type: object
@@ -81,15 +91,15 @@ index 4582107..54bbbf4 100644
8191
properties:
8292
result:
8393
$ref: '#/components/schemas/IssuerRevRegRecord'
84-
@@ -7479,6 +7469,7 @@ components:
94+
@@ -7479,6 +7470,7 @@ components:
8595
SchemaSendResult:
8696
required:
8797
- schema_id
8898
+ - schema
8999
type: object
90100
properties:
91101
schema:
92-
@@ -7617,10 +7608,7 @@ components:
102+
@@ -7617,10 +7609,7 @@ components:
93103
mechanism:
94104
type: string
95105
time:
@@ -100,31 +110,31 @@ index 4582107..54bbbf4 100644
100110
example: 1629715147
101111
TAAInfo:
102112
type: object
103-
@@ -7765,6 +7753,7 @@ components:
113+
@@ -7765,6 +7754,7 @@ components:
104114
example: 2021-08-23 10:39:07+00:00
105115
TxnOrCredentialDefinitionSendResult:
106116
type: object
107117
+ additionalProperties: false
108118
properties:
109119
sent:
110120
$ref: '#/components/schemas/CredentialDefinitionSendResult'
111-
@@ -7775,6 +7764,7 @@ components:
121+
@@ -7775,6 +7765,7 @@ components:
112122
- $ref: '#/components/schemas/TransactionRecord'
113123
TxnOrPublishRevocationsResult:
114124
type: object
115125
+ additionalProperties: false
116126
properties:
117127
sent:
118128
$ref: '#/components/schemas/PublishRevocations'
119-
@@ -7785,6 +7775,7 @@ components:
129+
@@ -7785,6 +7776,7 @@ components:
120130
- $ref: '#/components/schemas/TransactionRecord'
121131
TxnOrRevRegResult:
122132
type: object
123133
+ additionalProperties: false
124134
properties:
125135
sent:
126136
$ref: '#/components/schemas/RevRegResult'
127-
@@ -7795,6 +7786,7 @@ components:
137+
@@ -7795,6 +7787,7 @@ components:
128138
- $ref: '#/components/schemas/TransactionRecord'
129139
TxnOrSchemaSendResult:
130140
type: object

generator/data/openapi.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4965,7 +4965,8 @@ components:
49654965
description: Tag within credential definition identifier
49664966
example: tag
49674967
type:
4968-
type: object
4968+
enum:
4969+
- CL
49694970
description: 'Signature type: CL for Camenisch-Lysyanskaya'
49704971
example: CL
49714972
value:

0 commit comments

Comments
 (0)