eoap-problems-registry 1.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,15 @@
1
+ # Copyright 2026 EOAP
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ __version__ = "1.0.0"
@@ -0,0 +1,695 @@
1
+ # Copyright 2026 EOAP
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ # generated by datamodel-codegen:
16
+ # filename: schema.yaml
17
+ # timestamp: 2026-07-02T10:01:38+00:00
18
+
19
+ from __future__ import annotations
20
+ from pydantic import BaseModel
21
+ from pydantic import ConfigDict, Field, RootModel
22
+ from typing import Literal
23
+
24
+
25
+ class ErrorDetail(BaseModel):
26
+ """
27
+ An object to provide explicit details on a problem towards an API consumer.
28
+ """
29
+
30
+ model_config = ConfigDict(
31
+ extra="allow",
32
+ populate_by_name=True,
33
+ )
34
+ detail: str = Field(..., max_length=4096)
35
+ """
36
+ A granular description on the specific error related to a body property, query parameter, path parameters, and/or header.
37
+ """
38
+ pointer: str | None = Field(None, max_length=1024)
39
+ """
40
+ A JSON Pointer to a specific request body property that is the source of error.
41
+ """
42
+ parameter: str | None = Field(None, max_length=1024)
43
+ """
44
+ The name of the query or path parameter that is the source of error.
45
+ """
46
+ header: str | None = Field(None, max_length=1024)
47
+ """
48
+ The name of the header that is the source of error.
49
+ """
50
+ code: str | None = Field(None, max_length=50)
51
+ """
52
+ A string containing additional provider specific codes to identify the error context.
53
+ """
54
+
55
+
56
+ class ProblemDetails(BaseModel):
57
+ """
58
+ The `ProblemDetails` object provides detailed information about an errors that occurred during an API call execution. This problem object conforms to the [RFC9457](https://www.rfc-editor.org/info/rfc9457) (formerly [RFC7807](https://tools.ietf.org/html/rfc7807)).
59
+ The object is extended with the following properties: - `code` - a string identifier to aid the provider team better understand the error - `errors` - and array of errors providing contextual information on the root cause of the problem
60
+ The `ProblemDetails` referenced by this domain utilize the [EOAP Problems Registry](https://eoap.github.io/problems-registry/).
61
+ """
62
+
63
+ model_config = ConfigDict(
64
+ extra="allow",
65
+ populate_by_name=True,
66
+ )
67
+ instance: str | None = Field(None, max_length=1024)
68
+ """
69
+ A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
70
+ """
71
+ code: str | None = Field(None, max_length=50)
72
+ """
73
+ An API specific error code aiding the provider team understand the error based on their own potential taxonomy or registry.
74
+ """
75
+ errors: list[ErrorDetail] | None = Field(None, max_length=1000)
76
+ """
77
+ An array of error details to accompany a problem details response.
78
+ """
79
+
80
+
81
+ class AlreadyExists(ProblemDetails):
82
+ model_config = ConfigDict(
83
+ extra="allow",
84
+ populate_by_name=True,
85
+ )
86
+ type: Literal["https://eoap.github.io/problems-registry/already-exists"] = (
87
+ "https://eoap.github.io/problems-registry/already-exists"
88
+ )
89
+ """
90
+ A URI reference that identifies the problem type.
91
+ """
92
+ status: Literal[409] = 409
93
+ """
94
+ The HTTP status code generated by the origin server for this occurrence of the problem.
95
+ """
96
+ title: Literal["Already exists"] = "Already exists"
97
+ """
98
+ A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization.
99
+ """
100
+ detail: Literal["The resource being created already exists."] = (
101
+ "The resource being created already exists."
102
+ )
103
+ """
104
+ A human-readable explanation specific to this occurrence of the problem.
105
+ """
106
+
107
+
108
+ class BadRequest(ProblemDetails):
109
+ model_config = ConfigDict(
110
+ extra="allow",
111
+ populate_by_name=True,
112
+ )
113
+ type: Literal["https://eoap.github.io/problems-registry/bad-request"] = (
114
+ "https://eoap.github.io/problems-registry/bad-request"
115
+ )
116
+ """
117
+ A URI reference that identifies the problem type.
118
+ """
119
+ status: Literal[400] = 400
120
+ """
121
+ The HTTP status code generated by the origin server for this occurrence of the problem.
122
+ """
123
+ title: Literal["Bad Request"] = "Bad Request"
124
+ """
125
+ A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization.
126
+ """
127
+ detail: Literal["The request is invalid or malformed."] = (
128
+ "The request is invalid or malformed."
129
+ )
130
+ """
131
+ A human-readable explanation specific to this occurrence of the problem.
132
+ """
133
+
134
+
135
+ class BusinessRuleViolation(ProblemDetails):
136
+ model_config = ConfigDict(
137
+ extra="allow",
138
+ populate_by_name=True,
139
+ )
140
+ type: Literal[
141
+ "https://eoap.github.io/problems-registry/business-rule-violation"
142
+ ] = "https://eoap.github.io/problems-registry/business-rule-violation"
143
+ """
144
+ A URI reference that identifies the problem type.
145
+ """
146
+ status: Literal[422] = 422
147
+ """
148
+ The HTTP status code generated by the origin server for this occurrence of the problem.
149
+ """
150
+ title: Literal["Business Rule Violation"] = "Business Rule Violation"
151
+ """
152
+ A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization.
153
+ """
154
+ detail: Literal["The request body is invalid and not meeting business rules."] = (
155
+ "The request body is invalid and not meeting business rules."
156
+ )
157
+ """
158
+ A human-readable explanation specific to this occurrence of the problem.
159
+ """
160
+
161
+
162
+ class InvalidStateTransition(ProblemDetails):
163
+ model_config = ConfigDict(
164
+ extra="allow",
165
+ populate_by_name=True,
166
+ )
167
+ type: Literal[
168
+ "https://eoap.github.io/problems-registry/invalid-state-transition"
169
+ ] = "https://eoap.github.io/problems-registry/invalid-state-transition"
170
+ """
171
+ A URI reference that identifies the problem type.
172
+ """
173
+ status: Literal[422] = 422
174
+ """
175
+ The HTTP status code generated by the origin server for this occurrence of the problem.
176
+ """
177
+ title: Literal["Invalid State Transition"] = "Invalid State Transition"
178
+ """
179
+ A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization.
180
+ """
181
+ detail: Literal[
182
+ "The requested transition is not valid for the current item status."
183
+ ] = "The requested transition is not valid for the current item status."
184
+ """
185
+ A human-readable explanation specific to this occurrence of the problem.
186
+ """
187
+
188
+
189
+ class Forbidden(ProblemDetails):
190
+ model_config = ConfigDict(
191
+ extra="allow",
192
+ populate_by_name=True,
193
+ )
194
+ type: Literal["https://eoap.github.io/problems-registry/forbidden"] = (
195
+ "https://eoap.github.io/problems-registry/forbidden"
196
+ )
197
+ """
198
+ A URI reference that identifies the problem type.
199
+ """
200
+ status: Literal[403] = 403
201
+ """
202
+ The HTTP status code generated by the origin server for this occurrence of the problem.
203
+ """
204
+ title: Literal["Forbidden"] = "Forbidden"
205
+ """
206
+ A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization.
207
+ """
208
+ detail: Literal[
209
+ "The resource could not be returned as the requestor is not authorized."
210
+ ] = "The resource could not be returned as the requestor is not authorized."
211
+ """
212
+ A human-readable explanation specific to this occurrence of the problem.
213
+ """
214
+
215
+
216
+ class InvalidBodyPropertyFormat(ProblemDetails):
217
+ model_config = ConfigDict(
218
+ extra="allow",
219
+ populate_by_name=True,
220
+ )
221
+ type: Literal[
222
+ "https://eoap.github.io/problems-registry/invalid-body-property-format"
223
+ ] = "https://eoap.github.io/problems-registry/invalid-body-property-format"
224
+ """
225
+ A URI reference that identifies the problem type.
226
+ """
227
+ status: Literal[400] = 400
228
+ """
229
+ The HTTP status code generated by the origin server for this occurrence of the problem.
230
+ """
231
+ title: Literal["Invalid Body Property Format"] = "Invalid Body Property Format"
232
+ """
233
+ A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization.
234
+ """
235
+ detail: Literal["The request body contains a malformed property."] = (
236
+ "The request body contains a malformed property."
237
+ )
238
+ """
239
+ A human-readable explanation specific to this occurrence of the problem.
240
+ """
241
+
242
+
243
+ class InvalidBodyPropertyValue(ProblemDetails):
244
+ model_config = ConfigDict(
245
+ extra="allow",
246
+ populate_by_name=True,
247
+ )
248
+ type: Literal[
249
+ "https://eoap.github.io/problems-registry/invalid-body-property-value"
250
+ ] = "https://eoap.github.io/problems-registry/invalid-body-property-value"
251
+ """
252
+ A URI reference that identifies the problem type.
253
+ """
254
+ status: Literal[400] = 400
255
+ """
256
+ The HTTP status code generated by the origin server for this occurrence of the problem.
257
+ """
258
+ title: Literal["Invalid Body Property Value"] = "Invalid Body Property Value"
259
+ """
260
+ A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization.
261
+ """
262
+ detail: Literal["The request body contains an invalid body property value."] = (
263
+ "The request body contains an invalid body property value."
264
+ )
265
+ """
266
+ A human-readable explanation specific to this occurrence of the problem.
267
+ """
268
+
269
+
270
+ class InvalidParameters(ProblemDetails):
271
+ model_config = ConfigDict(
272
+ extra="allow",
273
+ populate_by_name=True,
274
+ )
275
+ type: Literal["https://eoap.github.io/problems-registry/invalid-parameters"] = (
276
+ "https://eoap.github.io/problems-registry/invalid-parameters"
277
+ )
278
+ """
279
+ A URI reference that identifies the problem type.
280
+ """
281
+ status: Literal[400] = 400
282
+ """
283
+ The HTTP status code generated by the origin server for this occurrence of the problem.
284
+ """
285
+ title: Literal["Invalid parameters"] = "Invalid parameters"
286
+ """
287
+ A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization.
288
+ """
289
+ detail: Literal[
290
+ "The request contained invalid, or malformed parameters (path or header or query)."
291
+ ] = "The request contained invalid, or malformed parameters (path or header or query)."
292
+ """
293
+ A human-readable explanation specific to this occurrence of the problem.
294
+ """
295
+
296
+
297
+ class InvalidRequestHeaderFormat(ProblemDetails):
298
+ model_config = ConfigDict(
299
+ extra="allow",
300
+ populate_by_name=True,
301
+ )
302
+ type: Literal[
303
+ "https://eoap.github.io/problems-registry/invalid-request-header-format"
304
+ ] = "https://eoap.github.io/problems-registry/invalid-request-header-format"
305
+ """
306
+ A URI reference that identifies the problem type.
307
+ """
308
+ status: Literal[400] = 400
309
+ """
310
+ The HTTP status code generated by the origin server for this occurrence of the problem.
311
+ """
312
+ title: Literal["Invalid Request Header Format"] = "Invalid Request Header Format"
313
+ """
314
+ A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization.
315
+ """
316
+ detail: Literal["The request contains a malformed request header parameter."] = (
317
+ "The request contains a malformed request header parameter."
318
+ )
319
+ """
320
+ A human-readable explanation specific to this occurrence of the problem.
321
+ """
322
+
323
+
324
+ class InvalidRequestParameterFormat(ProblemDetails):
325
+ model_config = ConfigDict(
326
+ extra="allow",
327
+ populate_by_name=True,
328
+ )
329
+ type: Literal[
330
+ "https://eoap.github.io/problems-registry/invalid-request-parameter-format"
331
+ ] = "https://eoap.github.io/problems-registry/invalid-request-parameter-format"
332
+ """
333
+ A URI reference that identifies the problem type.
334
+ """
335
+ status: Literal[400] = 400
336
+ """
337
+ The HTTP status code generated by the origin server for this occurrence of the problem.
338
+ """
339
+ title: Literal["Invalid Request Parameter Format"] = (
340
+ "Invalid Request Parameter Format"
341
+ )
342
+ """
343
+ A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization.
344
+ """
345
+ detail: Literal["The request contains a malformed request query parameter."] = (
346
+ "The request contains a malformed request query parameter."
347
+ )
348
+ """
349
+ A human-readable explanation specific to this occurrence of the problem.
350
+ """
351
+
352
+
353
+ class InvalidRequestParameterValue(ProblemDetails):
354
+ model_config = ConfigDict(
355
+ extra="allow",
356
+ populate_by_name=True,
357
+ )
358
+ type: Literal[
359
+ "https://eoap.github.io/problems-registry/invalid-request-parameter-value"
360
+ ] = "https://eoap.github.io/problems-registry/invalid-request-parameter-value"
361
+ """
362
+ A URI reference that identifies the problem type.
363
+ """
364
+ status: Literal[400] = 400
365
+ """
366
+ The HTTP status code generated by the origin server for this occurrence of the problem.
367
+ """
368
+ title: Literal["Invalid Request Parameter Value"] = (
369
+ "Invalid Request Parameter Value"
370
+ )
371
+ """
372
+ A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization.
373
+ """
374
+ detail: Literal["The request body contains an invalid request parameter value."] = (
375
+ "The request body contains an invalid request parameter value."
376
+ )
377
+ """
378
+ A human-readable explanation specific to this occurrence of the problem.
379
+ """
380
+
381
+
382
+ class LicenseCancelled(ProblemDetails):
383
+ model_config = ConfigDict(
384
+ extra="allow",
385
+ populate_by_name=True,
386
+ )
387
+ type: Literal["https://eoap.github.io/problems-registry/license-cancelled"] = (
388
+ "https://eoap.github.io/problems-registry/license-cancelled"
389
+ )
390
+ """
391
+ A URI reference that identifies the problem type.
392
+ """
393
+ status: Literal[503] = 503
394
+ """
395
+ The HTTP status code generated by the origin server for this occurrence of the problem.
396
+ """
397
+ title: Literal["License Cancelled"] = "License Cancelled"
398
+ """
399
+ A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization.
400
+ """
401
+ detail: Literal[
402
+ "The service is unavailable as the license associated with your client or organization has been cancelled. Please contact your account manager or representative."
403
+ ] = "The service is unavailable as the license associated with your client or organization has been cancelled. Please contact your account manager or representative."
404
+ """
405
+ A human-readable explanation specific to this occurrence of the problem.
406
+ """
407
+
408
+
409
+ class LicenseExpired(ProblemDetails):
410
+ model_config = ConfigDict(
411
+ extra="allow",
412
+ populate_by_name=True,
413
+ )
414
+ type: Literal["https://eoap.github.io/problems-registry/license-expired"] = (
415
+ "https://eoap.github.io/problems-registry/license-expired"
416
+ )
417
+ """
418
+ A URI reference that identifies the problem type.
419
+ """
420
+ status: Literal[503] = 503
421
+ """
422
+ The HTTP status code generated by the origin server for this occurrence of the problem.
423
+ """
424
+ title: Literal["License Expired"] = "License Expired"
425
+ """
426
+ A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization.
427
+ """
428
+ detail: Literal[
429
+ "The service is unavailable as the license associated with your client or organization has expired. Please contact your account manager or representative."
430
+ ] = "The service is unavailable as the license associated with your client or organization has expired. Please contact your account manager or representative."
431
+ """
432
+ A human-readable explanation specific to this occurrence of the problem.
433
+ """
434
+
435
+
436
+ class MissingBodyProperty(ProblemDetails):
437
+ model_config = ConfigDict(
438
+ extra="allow",
439
+ populate_by_name=True,
440
+ )
441
+ type: Literal["https://eoap.github.io/problems-registry/missing-body-property"] = (
442
+ "https://eoap.github.io/problems-registry/missing-body-property"
443
+ )
444
+ """
445
+ A URI reference that identifies the problem type.
446
+ """
447
+ status: Literal[400] = 400
448
+ """
449
+ The HTTP status code generated by the origin server for this occurrence of the problem.
450
+ """
451
+ title: Literal["Missing body property"] = "Missing body property"
452
+ """
453
+ A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization.
454
+ """
455
+ detail: Literal["The request is missing an expected body property."] = (
456
+ "The request is missing an expected body property."
457
+ )
458
+ """
459
+ A human-readable explanation specific to this occurrence of the problem.
460
+ """
461
+
462
+
463
+ class MissingRequestHeader(ProblemDetails):
464
+ model_config = ConfigDict(
465
+ extra="allow",
466
+ populate_by_name=True,
467
+ )
468
+ type: Literal["https://eoap.github.io/problems-registry/missing-request-header"] = (
469
+ "https://eoap.github.io/problems-registry/missing-request-header"
470
+ )
471
+ """
472
+ A URI reference that identifies the problem type.
473
+ """
474
+ status: Literal[400] = 400
475
+ """
476
+ The HTTP status code generated by the origin server for this occurrence of the problem.
477
+ """
478
+ title: Literal["Missing request header"] = "Missing request header"
479
+ """
480
+ A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization.
481
+ """
482
+ detail: Literal["The request is missing an expected HTTP request header."] = (
483
+ "The request is missing an expected HTTP request header."
484
+ )
485
+ """
486
+ A human-readable explanation specific to this occurrence of the problem.
487
+ """
488
+
489
+
490
+ class MissingRequestParameter(ProblemDetails):
491
+ model_config = ConfigDict(
492
+ extra="allow",
493
+ populate_by_name=True,
494
+ )
495
+ type: Literal[
496
+ "https://eoap.github.io/problems-registry/missing-request-parameter"
497
+ ] = "https://eoap.github.io/problems-registry/missing-request-parameter"
498
+ """
499
+ A URI reference that identifies the problem type.
500
+ """
501
+ status: Literal[400] = 400
502
+ """
503
+ The HTTP status code generated by the origin server for this occurrence of the problem.
504
+ """
505
+ title: Literal["Missing request parameter"] = "Missing request parameter"
506
+ """
507
+ A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization.
508
+ """
509
+ detail: Literal["The request is missing an expected query or path parameter."] = (
510
+ "The request is missing an expected query or path parameter."
511
+ )
512
+ """
513
+ A human-readable explanation specific to this occurrence of the problem.
514
+ """
515
+
516
+
517
+ class NotFound(ProblemDetails):
518
+ model_config = ConfigDict(
519
+ extra="allow",
520
+ populate_by_name=True,
521
+ )
522
+ type: Literal["https://eoap.github.io/problems-registry/not-found"] = (
523
+ "https://eoap.github.io/problems-registry/not-found"
524
+ )
525
+ """
526
+ A URI reference that identifies the problem type.
527
+ """
528
+ status: Literal[404] = 404
529
+ """
530
+ The HTTP status code generated by the origin server for this occurrence of the problem.
531
+ """
532
+ title: Literal["Not Found"] = "Not Found"
533
+ """
534
+ A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization.
535
+ """
536
+ detail: Literal["The requested resource was not found."] = (
537
+ "The requested resource was not found."
538
+ )
539
+ """
540
+ A human-readable explanation specific to this occurrence of the problem.
541
+ """
542
+
543
+
544
+ class ServerError(ProblemDetails):
545
+ model_config = ConfigDict(
546
+ extra="allow",
547
+ populate_by_name=True,
548
+ )
549
+ type: Literal["https://eoap.github.io/problems-registry/server-error"] = (
550
+ "https://eoap.github.io/problems-registry/server-error"
551
+ )
552
+ """
553
+ A URI reference that identifies the problem type.
554
+ """
555
+ status: Literal[500] = 500
556
+ """
557
+ The HTTP status code generated by the origin server for this occurrence of the problem.
558
+ """
559
+ title: Literal["Server Error"] = "Server Error"
560
+ """
561
+ A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization.
562
+ """
563
+ detail: Literal["The server encountered an unexpected error."] = (
564
+ "The server encountered an unexpected error."
565
+ )
566
+ """
567
+ A human-readable explanation specific to this occurrence of the problem.
568
+ """
569
+
570
+
571
+ class ServiceUnavailable(ProblemDetails):
572
+ model_config = ConfigDict(
573
+ extra="allow",
574
+ populate_by_name=True,
575
+ )
576
+ type: Literal["https://eoap.github.io/problems-registry/service-unavailable"] = (
577
+ "https://eoap.github.io/problems-registry/service-unavailable"
578
+ )
579
+ """
580
+ A URI reference that identifies the problem type.
581
+ """
582
+ status: Literal[503] = 503
583
+ """
584
+ The HTTP status code generated by the origin server for this occurrence of the problem.
585
+ """
586
+ title: Literal["Service Unavailable"] = "Service Unavailable"
587
+ """
588
+ A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization.
589
+ """
590
+ detail: Literal["The service is currently unavailable."] = (
591
+ "The service is currently unavailable."
592
+ )
593
+ """
594
+ A human-readable explanation specific to this occurrence of the problem.
595
+ """
596
+
597
+
598
+ class Unauthorized(ProblemDetails):
599
+ model_config = ConfigDict(
600
+ extra="allow",
601
+ populate_by_name=True,
602
+ )
603
+ type: Literal["https://eoap.github.io/problems-registry/unauthorized"] = (
604
+ "https://eoap.github.io/problems-registry/unauthorized"
605
+ )
606
+ """
607
+ A URI reference that identifies the problem type.
608
+ """
609
+ status: Literal[401] = 401
610
+ """
611
+ The HTTP status code generated by the origin server for this occurrence of the problem.
612
+ """
613
+ title: Literal["Unauthorized"] = "Unauthorized"
614
+ """
615
+ A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization.
616
+ """
617
+ detail: Literal[
618
+ "Access token not set or invalid, and the requested resource could not be returned."
619
+ ] = "Access token not set or invalid, and the requested resource could not be returned."
620
+ """
621
+ A human-readable explanation specific to this occurrence of the problem.
622
+ """
623
+
624
+
625
+ class ValidationError(ProblemDetails):
626
+ model_config = ConfigDict(
627
+ extra="allow",
628
+ populate_by_name=True,
629
+ )
630
+ type: Literal["https://eoap.github.io/problems-registry/validation-error"] = (
631
+ "https://eoap.github.io/problems-registry/validation-error"
632
+ )
633
+ """
634
+ A URI reference that identifies the problem type.
635
+ """
636
+ status: Literal[422] = 422
637
+ """
638
+ The HTTP status code generated by the origin server for this occurrence of the problem.
639
+ """
640
+ title: Literal["Validation Error"] = "Validation Error"
641
+ """
642
+ A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization.
643
+ """
644
+ detail: Literal["The request is not valid."] = "The request is not valid."
645
+ """
646
+ A human-readable explanation specific to this occurrence of the problem.
647
+ """
648
+
649
+
650
+ class EoapProblemDetailsRegistry(
651
+ RootModel[
652
+ AlreadyExists
653
+ | BadRequest
654
+ | BusinessRuleViolation
655
+ | Forbidden
656
+ | InvalidBodyPropertyFormat
657
+ | InvalidBodyPropertyValue
658
+ | InvalidParameters
659
+ | InvalidRequestHeaderFormat
660
+ | InvalidRequestParameterFormat
661
+ | InvalidRequestParameterValue
662
+ | LicenseCancelled
663
+ | LicenseExpired
664
+ | MissingBodyProperty
665
+ | MissingRequestHeader
666
+ | MissingRequestParameter
667
+ | NotFound
668
+ | ServerError
669
+ | ServiceUnavailable
670
+ | Unauthorized
671
+ | ValidationError
672
+ ]
673
+ ):
674
+ root: (
675
+ AlreadyExists
676
+ | BadRequest
677
+ | BusinessRuleViolation
678
+ | Forbidden
679
+ | InvalidBodyPropertyFormat
680
+ | InvalidBodyPropertyValue
681
+ | InvalidParameters
682
+ | InvalidRequestHeaderFormat
683
+ | InvalidRequestParameterFormat
684
+ | InvalidRequestParameterValue
685
+ | LicenseCancelled
686
+ | LicenseExpired
687
+ | MissingBodyProperty
688
+ | MissingRequestHeader
689
+ | MissingRequestParameter
690
+ | NotFound
691
+ | ServerError
692
+ | ServiceUnavailable
693
+ | Unauthorized
694
+ | ValidationError
695
+ ) = Field(..., title="EOAP Problem Details Registry")
@@ -0,0 +1,188 @@
1
+ Metadata-Version: 2.4
2
+ Name: eoap-problems-registry
3
+ Version: 1.0.0
4
+ Summary: EOAP Problems Registry
5
+ Project-URL: Documentation, https://eoap.github.io/problems-registry/
6
+ Project-URL: Issues, https://github.com/eoap/problems-registry/issues
7
+ Project-URL: Source, https://github.com/eoap/problems-registry
8
+ Author-email: Fabrice Brito <info@terradue.com>, Simone Tripodi <info@terradue.com>
9
+ License-Expression: Apache-2.0
10
+ License-File: LICENSE
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Programming Language :: Python
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Programming Language :: Python :: 3.14
18
+ Classifier: Programming Language :: Python :: Implementation :: CPython
19
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
20
+ Requires-Python: >=3.8
21
+ Requires-Dist: pydantic==2.13.4
22
+ Description-Content-Type: text/markdown
23
+
24
+ # EOAP Problems Registry
25
+
26
+ [![PyPI - Version](https://img.shields.io/pypi/v/eoap-problems-registry.svg)](https://pypi.org/project/eoap-problems-registry)
27
+ [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/eoap-problems-registry.svg)](https://pypi.org/project/eoap-problems-registry)
28
+
29
+ [EOAP Problems Registry](https://eoap.github.io/problems-registry/) is a shared registry of API problem detail types for EOAP services. The problem responses conform to [RFC 9457](https://www.rfc-editor.org/info/rfc9457), formerly [RFC 7807](https://www.rfc-editor.org/info/rfc7807), and are published as documentation, JSON Schema/OpenAPI artifacts, and a Python package with generated Pydantic models.
30
+
31
+ The registry is intended to give API providers and consumers a common vocabulary for reusable `application/problem+json` responses.
32
+
33
+ ## What Is Included
34
+
35
+ - `schemas/schema.yaml`: JSON Schema definitions for the common `ProblemDetails`, `ErrorDetail`, and each registered EOAP problem type.
36
+ - `schemas/openapi.yaml`: reusable OpenAPI 3.1 response components and examples that reference the JSON Schema definitions.
37
+ - `src/eoap_problems_registry`: generated Pydantic models for the registry.
38
+ - `docs/`: MkDocs pages for each problem type, plus generated JSON Schema and OpenAPI documentation.
39
+ - `tests/`: unit tests that verify generated problem models and extension behavior.
40
+ - `.github/workflows/`: documentation deployment, package CI, and PyPI release automation.
41
+
42
+ ## Registered Problems
43
+
44
+ EOAP-specific problem types:
45
+
46
+ | Problem type | HTTP status |
47
+ | --- | --- |
48
+ | Already Exists | 409 |
49
+ | Missing Body Property | 400 |
50
+ | Missing Request Header | 400 |
51
+ | Missing Request Parameter | 400 |
52
+ | Invalid Body Property Format | 400 |
53
+ | Invalid Request Parameter Format | 400 |
54
+ | Invalid Request Header Format | 400 |
55
+ | Invalid Body Property Value | 400 |
56
+ | Invalid Request Parameter Value | 400 |
57
+ | Validation Error | 422 |
58
+ | Business Rule Violation | 422 |
59
+ | License Expired | 503 |
60
+ | License Cancelled | 503 |
61
+
62
+ Common convenience problem types:
63
+
64
+ | Problem type | HTTP status |
65
+ | --- | --- |
66
+ | Bad Request | 400 |
67
+ | Unauthorized | 401 |
68
+ | Forbidden | 403 |
69
+ | Not Found | 404 |
70
+ | Invalid Parameters | 400 |
71
+ | Server Error | 500 |
72
+ | Service Unavailable | 503 |
73
+
74
+ For generic/common HTTP problem types, prefer the [IANA HTTP Problem Types registry](https://www.iana.org/assignments/http-problem-types/http-problem-types.xhtml) when it fits your use case.
75
+
76
+ ## Python Usage
77
+
78
+ Install the package in an environment with Pydantic 2:
79
+
80
+ ```bash
81
+ pip install eoap-problems-registry
82
+ ```
83
+
84
+ Use the generated models to build responses with fixed registry fields and optional extension members:
85
+
86
+ ```python
87
+ import eoap_problems_registry as registry
88
+
89
+ problem = registry.MissingRequestParameter(
90
+ instance="https://api.example.test/problems/abc123",
91
+ code="400-03",
92
+ errors=[
93
+ registry.ErrorDetail(
94
+ detail="The query parameter limit is required.",
95
+ parameter="limit",
96
+ )
97
+ ],
98
+ correlation_id="req-123",
99
+ )
100
+
101
+ payload = problem.model_dump(mode="json", exclude_none=True)
102
+ ```
103
+
104
+ The resulting payload includes the registered `type`, `status`, `title`, and `detail` values:
105
+
106
+ ```json
107
+ {
108
+ "instance": "https://api.example.test/problems/abc123",
109
+ "code": "400-03",
110
+ "errors": [
111
+ {
112
+ "detail": "The query parameter limit is required.",
113
+ "parameter": "limit"
114
+ }
115
+ ],
116
+ "type": "https://eoap.github.io/problems-registry/missing-request-parameter",
117
+ "status": 400,
118
+ "title": "Missing request parameter",
119
+ "detail": "The request is missing an expected query or path parameter.",
120
+ "correlation_id": "req-123"
121
+ }
122
+ ```
123
+
124
+ `ProblemDetails` and `ErrorDetail` allow additional provider-specific fields, while generated problem classes use Pydantic literal fields to protect the registered `type`, `status`, `title`, and `detail` values.
125
+
126
+ ## Schemas And OpenAPI
127
+
128
+ Use the schema and OpenAPI files directly when integrating the registry into API descriptions:
129
+
130
+ - JSON Schema definitions: [`schemas/schema.yaml`](schemas/schema.yaml)
131
+ - OpenAPI response components and examples: [`schemas/openapi.yaml`](schemas/openapi.yaml)
132
+ - Published documentation: <https://eoap.github.io/problems-registry/>
133
+
134
+ When a response needs more context, include an `errors` array. Each item must contain `detail` and may include `pointer`, `parameter`, `header`, `code`, or provider-specific extension fields.
135
+
136
+ ## Development
137
+
138
+ This repository uses Hatch for Python environments, Ruff for formatting/linting, MkDocs for documentation, and Taskfile tasks for generated artifacts.
139
+
140
+ Useful commands:
141
+
142
+ ```bash
143
+ hatch run test:test
144
+ hatch run test:testv
145
+ hatch run test:cov
146
+ hatch run dev:lint
147
+ hatch run dev:check
148
+ task process_schema
149
+ task generate_openapi_docs
150
+ task serve_docs
151
+ ```
152
+
153
+ `task process_schema` regenerates the Pydantic models in `src/eoap_problems_registry/__init__.py` and the JSON Schema documentation in `docs/json-schema.md`.
154
+
155
+ `task generate_openapi_docs` regenerates the static OpenAPI documentation under `docs/openapi/`.
156
+
157
+ `task serve_docs` starts the MkDocs site locally.
158
+
159
+ ## Contributing Problem Types
160
+
161
+ To add or update a problem type:
162
+
163
+ 1. Update `schemas/schema.yaml` with the JSON Schema definition under `$defs`.
164
+ 2. Update `schemas/openapi.yaml` if the problem should be exposed through reusable OpenAPI response components or examples.
165
+ 3. Add or update the matching Markdown page in `docs/`.
166
+ 4. Add the page to the `nav` section in `mkdocs.yaml`.
167
+ 5. Run `task process_schema` to regenerate the Python models and schema docs.
168
+ 6. Run `task generate_openapi_docs` if OpenAPI components or examples changed.
169
+ 7. Add or update tests in `tests/` when generated behavior changes.
170
+ 8. Run the test and lint commands before opening a pull request.
171
+
172
+ Problem type URIs should use the published registry base URL:
173
+
174
+ ```text
175
+ https://eoap.github.io/problems-registry/{problem-name}
176
+ ```
177
+
178
+ Use hyphen-separated names for problem page filenames and URI suffixes, for example `missing-body-property`.
179
+
180
+ ## CI And Releases
181
+
182
+ The package workflow runs Ruff and the unit test suite on Python 3.10 through 3.14 for pushes and pull requests targeting the active development branches. Version tags matching `v*.*.*` build and publish the package to PyPI after verifying that the tag version matches `hatch version`.
183
+
184
+ The docs workflow publishes the MkDocs site to GitHub Pages when documentation-related files change on `docs`, `develop`, or `main`.
185
+
186
+ ## License
187
+
188
+ [![Apache License, Version 2.0](https://img.shields.io/badge/license-Apache%20License%202.0-blue)](https://www.apache.org/licenses/LICENSE-2.0)
@@ -0,0 +1,6 @@
1
+ eoap_problems_registry/__about__.py,sha256=f3IRf3CBO4uARSCEumpBE9Su29QRZUHpjga30bIMEvM,591
2
+ eoap_problems_registry/__init__.py,sha256=aOQK6fvLmwEMfw1JDG7A37h2YZoDpmRGYMqcmQBMIKY,25796
3
+ eoap_problems_registry-1.0.0.dist-info/METADATA,sha256=ZRabItztDhVJ7vlyLtk7w74tCNpfwFfBxoznMXMSMvI,7604
4
+ eoap_problems_registry-1.0.0.dist-info/WHEEL,sha256=lCkmxWfQsSc9CfIClYeavTdQeEX2toPqufh9gI35EQA,87
5
+ eoap_problems_registry-1.0.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
6
+ eoap_problems_registry-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.31.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.