File size: 66,259 Bytes
ab74ec2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
# camara-service-capability-openapi

```yaml
---
openapi: 3.0.3
info:
  title: CAMARA Service Capability API
  description: |
    The CAMARA Service Capability API provides programmable interface for developers and other users (capabilities consumers) to discover and be notified
    about active/inactive capabilities (functions) for APIs.

    It delivers a tailored service capability based on consumer context, supporting complex request bodies, endpoint removal, and dynamic restrictions.

    # Introduction
    This API enables feature discovery and near-real-time feature status notifications for APIs provided by the gateway / provider.

    Overlay-based restrictions use JSON Schema Validation (draft-bhutton-json-schema-validation-01) keywords and ensure restriction-only constraints.
    The specification supports dynamic tailoring via `POST /camara/service/capability/v0`, which returns a restriction mapping with bit positions, capability identifiers,
    and a mapping version. Initial restriction states are included in the successful response. Restriction state changes are notified via CloudEvents using bitmap-only
    payloads for restrictions and leveraging the restriction mapping for synchronization. Versioning ensures consumers adapt to mapping changes.

    Overlays conform to the OpenAPI Overlay specification (https://spec.openapis.org/overlay/latest.html) and are evaluated at run-time rather than build-time on API consumer side using
    context-aware logic. Only schema-restrictive updates are allowed (e.g., narrowing enums, removing operations).  These extensions enable fine-grained control over API capabilities
    by applying restriction-only constraints to schemas, body fields, and headers/parameters, respectively.

    An **API** (Application Programming Interface) often includes **features** that can be *active* or *inactive* during
    interactions with API consumers. For example, feature negotiation during session establishment or events such as high congestion that
    change a feature's status.

    **Capabilities** represent a collection of features and their **status** (*active* or *inactive*) at runtime.
    These capabilities provide a way to describe what an API can do.

    **Footprints** define the coverage area where specific capabilities are available. A device must be located within the footprint to access
    these capabilities. If no footprint is specified, the capabilities *may* be available to *any* device connected to the network. Footprints
    have a *usage type* that determines their visibility and use. For example, some footprints may only be visible to Access Networks where
    devices are attached, while others may be visible to Internet servers or services in a Non-Access network. Some footprints
    may even be used in both types of networks.

    The API provider MAY have full knowledge of whereabout of the device, thus directly notifying the capabilities consumers
    with near-real-time capability changes resulting of device location change without using footprints. This would reduce the additional footprint processing requirement at the consumer side
    when the device receives the capability notification and capability info.

    When footprints are used, they are presented as part of a collection. A device is considered to be covered by a footprint collection if it
    falls within at least one footprint in the collection. Footprint *precedence* specifies the search execution order of footprints in the
    collection. The lower the numerical value of precedence, the higher the footprint precedence. Footprints with equal precedence MAY be
    executed in parallel if supported by the system. (see *Usage* for more detail).

    To convey the impact of capability status to API consumers in a meaningful way, capabilities are directly tied to a set of **Runtime Restrictions**.
    These restrictions affect optional or alternative structures, parameters, and other aspects of API usage.

    # Usage
    The Camara Service Capability API enables clients to discover and manage CAMARA API capabilities
    through a simple, RESTful interface and receive automatic CloudEvents when state changes.
    ```mermaid
            Client            Webhook/Sink       Capability API        CloudEvents Broker
              |                     |                   |                        |
              |---------------------------------------->|                        |
              | POST /camara/service/capability/v0      |                        |
              |<----------------------------------------|                        |
              |     201 + CapabilityInfo                |                        |
              |                     |                   |                        |
              |                     |                   |----------------------> |
              |                     |                   | Create Subscription    |
              |                     |                   |   for capability       |
              |                     |                   |   changes              |
              |                     |                   |----------------------->|
              |                     |                   | Capability Changed     |
              |                     |<-------------------------------------------|
              |                     |     POST CloudEvent to Webhook             |
              |                     |                   |                        |
              |                     |------------------------------------------->|
              |                     |                  204                       |
              |                     |                   |                        |
        The Capability API responds with the supported capabilities and then internally
        registers for capability change events if 'subscriptionRequest' is provided in the request.
        As capabilities change event notifications are forwarded through a CloudEvents Broker to
        the client-provided Webhook (Sink).
    ```
    **How it works**
    1. **Query capabilities**
       Client sends one or more `CamaraCapabilityQuery` objects to `/camara/service/capability/v0`.
    2. **Inspect response**
       API returns a `CapabilityInfo` object with per-capability details, overlays, and restriction sets.
    3. **Receive updates automatically**
       Whenever capability bitmaps or info change, the API emits a CloudEvent (via implicit subscription)
       to your configured webhook sink endpoint.
    **Supported CloudEvent types:**
    - `org.camaraproject.capability.v0.capability-bitmap-changed`
    - `org.camaraproject.capability.v0.capability-info-changed`
    For full schema definitions and examples, see the components section below.

    ### Summary:
    1. `POST /camara/service/capability/v0`: Returns tailored CapabilityBitmap that assigns bit positions of each restriction, a mappingVersion for versioning for new restrictions.
    2. CloudEvents Notifications: Signals restriction state changes (active/inactive) via bitmap change event and new restrictions via info change event, ensuring efficient synchronization.
    3. Versioning: Uses mappingVersion to handle changes in the restriction mapping, preventing synchronization errors.

    # Relevant terms and definitions
    * **Authentication**:
    Security access keys such as OAuth 2.0 client credentials used by client applications to invoke the Capability API.
    * **API (Application Programming Interface)**:
    A set of protocols and tools for building software and applications.
    * **Features**:
    Specific functions or capabilities of an API that can be *active* or *inactive*.
    * **Capabilities**:
    A collection of features and their status (*active* or *inactive*) at a specific point in time.
    * **Footprints**:
    Define the coverage area where specific capabilities are available.
    * **Runtime Restrictions**:
    Restrictions that affect optional or alternative structures, parameters, and other aspects of API usage using a collection of overlays.
    There are two kinds of overlays. The openAPI Overlays specification is at https://spec.openapis.org/overlay/latest.html.
    One kind is the static version of overlays which can be applied to the API spec at the build time of the
    Client. The actions of the overlays are known to the Client before any runtime. Second kind is the one we're specifying in this CAMARA
    Service Capability API specification where the overlays take effect at the runtime of the Client if the Client supports this specification.
    The actions of any overlays are not known to the Client until they're communicated from the API provider at the runtime of the Client.

    # API functionality
    Please see examples within this yaml on what options the gateway may return in the response.

    # Further info and support

    ## Frequently Asked Questions (FAQs)
    1. What is the purpose of the API described in the text?
    The API enables feature discovery and near-real-time feature status notifications
    for APIs provided by the gateway.
    2. What are capabilities and how do they relate to API features?
    Capabilities represent a collection of features and their
    status (*active* or *inactive*) at a specific point in time. These capabilities provide a way to describe what an API can do.
    3. What are footprints and how do they affect the availability of capabilities?
    Footprints define the coverage area where specific
    capabilities are available. A device must be located within the footprint to access these capabilities. If no footprint is specified,
    the capabilities may be available to any device connected to the network.
    4. What is the role of footprint precedence in the search execution order?
    Footprint precedence specifies the search execution order of
    Footprints in the collection. The lower the numerical value of precedence, the higher the Footprint precedence. Footprints with equal
    precedence may be executed in parallel if supported by the system.
    5. How do runtime restrictions affect API usage?
    To convey the impact of capability status to API consumers in a meaningful way,
    capabilities are directly tied to a set of runtime restrictions. These restrictions affect optional or alternative structures,
    parameters, and other aspects of API usage using a collection of overlays.
    6. What if a Client does not support this API?
    They can send requests without using this API. The downside
    is that they may send requests that are invalid and could have been avoided with information from this API. They
    could be more proactive by disabling / hiding options that are not enabled in the Client which improves user
    experience.
    7. What if a Client does not support Footprints or a specific Footprint type?
    They should ignore enforcing the
    state of the specific capability. This may result in sending invalid requests.
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  version: wip
  x-camara-commonalities: tbd
externalDocs:
  description: Product documentation at Camara
  url: https://github.com/camaraproject/
servers:
  - url: '{apiRoot}/camara-service-capability-openapi/vwip'
    variables:
      apiRoot:
        default: http://localhost:9091
        description: API root
tags:
  - name: CAMARA Service Capability Query
    description: Returns the Service Capability for specified CAMARA service APIs
      on the API gateway / producer side.
  - name: CAMARA Service Capability notifications callback
    description: Callback endpoint for receiving notifications on capability changes.
paths:
  /camara/service/capability/v0:
    post:
      tags: [CAMARA Service Capability Query]
      summary: Retrieve tailored service capabilities based on consumer context
      description: |
        Returns service capability information tailored to the consumer's context, including active/inactive restrictions and mapping metadata.
        Successful response is with sets of restrictions based on consumer context, along with a restriction mapping assigning bit positions,
        capability identifiers, and a mapping version. It includes response with initial bitmaps which should be enforced on the API consumer side.
      operationId: postServiceCapability
      parameters:
        - $ref: '#/components/parameters/x-correlator'
        - $ref: '#/components/parameters/If-None-Match'
        - $ref: '#/components/parameters/If-Modified-Since'
      security:
        - openId: [camara-capability:read]
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CamaraCapabilityQueryRequest'
            examples:
              CAMARA_CAPABILITY_QUERY_REQUEST_EXAMPLE:
                $ref: '#/components/examples/CAMARA_CAPABILITY_QUERY_REQUEST_EXAMPLE'
      callbacks:
        notifications:
          '{$request.body#/subscriptionRequest/sink}':
            post:
              tags: [CAMARA Service Capability notifications callback]
              summary: CAMARA Service Capability notifications callback
              description: |
                Important: this endpoint is to be implemented by the API consumer.
                The API provider will call this endpoint whenever any CAMARA Service Capability change related event occurs.
                Currently only EVENT_CAPABILITY_CHANGED and EVENT_CAPABILITY_REMOVED events are defined.
              operationId: postCapabilityNotification
              parameters:
                - $ref: '#/components/parameters/x-correlator'
              requestBody:
                required: true
                content:
                  application/cloudevents-batch+json:
                    schema:
                      type: array
                      items:
                        $ref: '#/components/schemas/CloudEvent'
                    examples:
                      EVENT_CAPABILITY_BITMAP_CHANGED_BATCH_EXAMPLE:
                        $ref: '#/components/examples/EVENT_CAPABILITY_BITMAP_CHANGED_BATCH_EXAMPLE'
                      EVENT_CAPABILITY_INFO_CHANGED_BATCH_EXAMPLE:
                        $ref: '#/components/examples/EVENT_CAPABILITY_INFO_CHANGED_BATCH_EXAMPLE'
              responses:
                '204':
                  description: Successful notification
                  headers:
                    x-correlator:
                      $ref: '#/components/headers/x-correlator'
                '400':
                  $ref: '#/components/responses/Generic400'
                '401':
                  $ref: '#/components/responses/Generic401'
                '403':
                  $ref: '#/components/responses/Generic403'
                '410':
                  $ref: '#/components/responses/Generic410'
              security:
                - notificationsBearerAuth: []
      responses:
        '201':
          description: Tailored Capability info with current restriction mapping
          headers:
            x-correlator:
              $ref: '#/components/headers/x-correlator'
            ETag:
              $ref: '#/components/headers/ETag'
            Cache-Control:
              $ref: '#/components/headers/Cache-Control'
            Last-Modified:
              $ref: '#/components/headers/Last-Modified'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CapabilityInfo'
              examples:
                CAMARA_CAPABILITY_QUERY_REQUEST_RESPONSE_EXAMPLE:
                  $ref: '#/components/examples/CAMARA_CAPABILITY_QUERY_REQUEST_RESPONSE_EXAMPLE'
        '304':
          $ref: '#/components/responses/CapabilityNotModified304'
        '400':
          $ref: '#/components/responses/CapabilityApiBadRequest400'
        '401':
          $ref: '#/components/responses/Generic401'
        '403':
          $ref: '#/components/responses/Generic403'
        '404':
          $ref: '#/components/responses/CapabilityApiNotFound404'
        '500':
          $ref: '#/components/responses/Generic500'
        '503':
          $ref: '#/components/responses/Generic503'
components:
  securitySchemes:
    openId:
      $ref: ../common/CAMARA_common.yaml#/components/securitySchemes/openId
    notificationsBearerAuth:
      $ref: ../common/CAMARA_common.yaml#/components/securitySchemes/notificationsBearerAuth
  parameters:
    x-correlator:
      $ref: ../common/CAMARA_common.yaml#/components/parameters/x-correlator
    If-None-Match:
      $ref: ../common/CAMARA_common.yaml#/components/parameters/If-None-Match
    If-Modified-Since:
      $ref: ../common/CAMARA_common.yaml#/components/parameters/If-Modified-Since
  headers:
    x-correlator:
      $ref: ../common/CAMARA_common.yaml#/components/headers/x-correlator
    Cache-Control:
      $ref: ../common/CAMARA_common.yaml#/components/headers/Cache-Control
    ETag:
      $ref: ../common/CAMARA_common.yaml#/components/headers/ETag
    Last-Modified:
      $ref: ../common/CAMARA_common.yaml#/components/headers/Last-Modified
  schemas:
    # General items used throughout the specification
    Contexts:
      description: |
        An extensible container for reusable objects referenced by Overlays. It may reflect state of the API Service, client state, etc.
      type: object
      properties:
        url:
          type: string
          format: uri
          description: The resolved request URL.
        method:
          type: string
          description: HTTP method in upper-case.
        request:
          $ref: '#/components/schemas/HttpMessage'
      additionalProperties: true
      required: [url, method, request]
    HttpMessage:
      type: object
      description: Common structure for $request and, if supported, $response.
      properties:
        header:
          type: object
          # Valid header *names* (field-name = token)
          description: |
            A map of HTTP header fields.
            **Header names (object keys)** SHOULD conform to the RFC-7230 `token` syntax:
            `^[!#$%&'*+\-\.^_`|~0-9A-Za-z]+$`
            Note: OpenAPI 3.0.3 cannot enforce key-name patterns natively.
          additionalProperties:
            type: string
            pattern: ^[\t\x20-\x7E\x80-\xFF]*$
            description: Value of the header field (matches `field-value` ABNF)
        query:
          type: object
          description: Query-string parameters; keys are already decoded.
          additionalProperties: true
        path:
          type: object
          description: Captured path parameters.
          additionalProperties: true
        body:
          description: Request or response payload. Its shape depends on Content-Type.
      additionalProperties: false
    VersionedName:
      description: |
        An abstract base object containing names with versioning
      type: object
      properties:
        name:
          description: The item's name. Ideally, it is a unique value for its type.
            This value MUST NOT contain the semicolon - ';'
          type: string
          example: cap1
          minLength: 3
          maxLength: 256
          pattern: ^[^;]*$
        version:
          description: |
            The semantic version of the object instance following [SemVer 2.0.0](https://semver.org/).
            Examples:
            - `1.0.0`
            - `2.3.1-beta`
            - `1.4.5+build.2025`
          type: string
          example: 1.0.0
          minLength: 1
          pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[A-Za-z-][0-9A-Za-z-]*)(?:\.(?:0|[1-9]\d*|\d*[A-Za-z-][0-9A-Za-z-]*))*))?(?:\+([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$
        specifyingBody:
          description: Entity's specification organization (reversed fqdn format)
          type: string
          minLength: 1
      required: [name, version]
    Footprint:
      description: |
        The coverage area to which capabilities apply. They help define the context in which the features are relevant.
        There are many ways to describe a footprint -- for example, by address range (e.g., IPv4 CIDR or IPv6 CIDR (Classless Inter-Domain Routing),
        network ID (e.g., Autonomous System Number (ASN)), nation boundaries (e.g., country code) or GPS coordinates.
        When a **Footprint** value is not present, the capabilities apply to *any* connected device.
      allOf:
        - $ref: '#/components/schemas/VersionedName'
        - type: object
          properties:
            footprintType:
              description: |
                Types include:
                * [Content Delivery Network Interconnection](https://www.iana.org/assignments/cdni-parameters/cdni-parameters.xhtml#metadata-footprint-types) types
                * [Geo position](https://www.iana.org/assignments/method-tokens/method-tokens.xhtml) types
                * [Civic Address](https://datamodel.tmforum.org/en/latest/Common/Address/) types
                * [Geographic Address type](https://github.com/tmforum-apis/TMF673_GeographicAddress) types
                * [Geographic Location type](https://github.com/tmforum-apis/TMF675_GeographicLocation) types
                * [Geographic Site type](https://github.com/tmforum-apis/TMF674_GeographicSite) types
                * [ITU E.212 Mobile Country Code and Mobile Network Code](https://en.wikipedia.org/wiki/Mobile_country_code) values
                * [GeoJSON](https://github.com/geojson/schema)
                * [TopoJSON](https://github.com/topojson/topojson)
                * [IP Geolocation Feeds (geofeed)](https://datatracker.ietf.org/doc/rfc8805/)
              type: string
              enum:
                - ipv4cidr
                - ipv6cidr
                - asn
                - countrycode
                - altopid
                - subdivisioncode
                - footprintunion
                - civicaddress
                - geoposition
                - itue212countrynetworkcode
                - postaladdress
                - geographicaddress
                - geographiclocation
                - geographicsite
                - geojson
                - topojson
                - geofeedRFC8805
            footprintValue:
              description: A list of footprint values.
              type: array
              items:
                oneOf:
                  - type: string
                  - type: object
            footprintUsage:
              description: Indicates that the footprint value represents an Access
                Network, a non Access Network, i.e., networks facing the Internet,
                or both.
              type: string
              enum: [access, non_access, both]
            precedence:
              description: |
                Specifies the search execution order of Footprints when they are part of a collection. The lower the numerical value of precedence,
                the higher the rule precedence. Rules with equal precedence MAY be executed in parallel if supported.
              type: integer
              minimum: 0
      required:
        - name
        - version
        - footprintType
        - footprintValue
        - footprintUsage
        - precedence
    Metadata:
      description: >
        Tighten validation, avoid client/server drift, and make structures robust.
      type: object
      properties:
        description:
          type: string
          description: Human-readable description of the entity
        createdAt:
          type: string
          format: date-time
          description: |
            RFC 3339 timestamp when this mapping was first published.
            Providers must not set times in the future.
          example: '2025-05-09T14:25:38Z'
        lastModifiedAt:
          type: string
          format: date-time
          description: |
            RFC 3339 timestamp of the last non-breaking update.
            Providers must not set times in the future.
          example: '2025-05-10T12:03:00Z'
        deprecatedAt:
          type: string
          format: date-time
          description: RFC 3339 timestamp after which this entity is no longer be
            applicable.
        mappingHash:
          type: string
          pattern: ^[A-Fa-f0-9]{64}$  # SHA-256 in hex
          description: SHA-256 digest of the canonical JSON representation of this
            mapping.
          example: 5d41402abc4b2a76b9719d911017c592cf0c58f2b3b65af6f88ab3a2b4d6996f
        traceID:
          type: string
          description: Trace Identifier used across multiple systems.

    # Overlay imports
    Overlay:
      $ref: ../modules/overlay-openapi.yaml#/components/schemas/Overlay
    Action:
      $ref: ../modules/overlay-openapi.yaml#/components/schemas/Action-Object
    Extends:
      $ref: ../modules/overlay-openapi.yaml#/components/schemas/Extends

    # Camara extensions to Open API Overlay components
    CamaraOverlay:
      description: |
        Common attributes of a CAMARA Overlay.
        It extends OpenAPI Overlay Specification v1.0.0 for restriction-only schema patches.
      allOf:
        - $ref: '#/components/schemas/Overlay'
        - $ref: '#/components/schemas/VersionedName'
        - $ref: '#/components/schemas/Metadata'
        - type: object
          properties:
            actions:
              description: A ordered list of actions
              type: array
              minItems: 1
              maxItems: 20  # DoS - guard rail
              uniqueItems: true
              items:
                $ref: '#/components/schemas/CamaraAction'
            operator:
              description: |
                Logical operator combining the results of all actions:
                - **and**: all actions must succeed; processing stops on first failure
                - **or**: failed actions are skipped
              type: string
              enum: [and, or]
              default: and
          required: [name, version, actions]
    CamaraAction:
      type: object
      description: |
        Extends a standard Overlay Action-Object by
        a. refining update to ONLY accept SchemaRestriction
        b. letting the API provider pre-compute exactly which nodes will be
           affected, using either JSON Pointers or OpenAPI runtime expressions.
           This makes it possible to:
        1. **target** an OpenAPI document fragment (via JSONPath).
        2. **Resolve** that target against an instance of the Open API schema
            into one or more concrete locations—each expressed as either a JSON Pointer
            or an OpenAPI runtime expression.
        3. **Apply** the `update` or `remove` action deterministically to those
          resolved locations.
        By including `targetLocations`, clients can skip the extra step of evaluating
        `target` themselves against instances of the schema, ensuring precise,
        unambiguous application and enabling robust validation through attached `SchemaRestrictions`.
        When targetLocations is present, any target value MUST be ignored.
      allOf:
        - $ref: '#/components/schemas/Action'
      properties:
        id:
          type: string
          description: Identifier for this action. Used for tracability. Each id MUST
            be unique within the overlay.
        targetLocations:
          description: |
            A non-empty list of explicit document locations—specified as a
              InstanceLocation. These values override the generic `target`
              selector.

              All entries MUST use the same syntax (Runtime Expression or JSON Pointer).
          type: array
          minItems: 1
          maxItems: 30
          items:
            $ref: '#/components/schemas/InstanceLocation'
        # refinement of update - it can only take on
        update:
          description: update of schema restrictions
          type: object
          additionalProperties:
            $ref: '#/components/schemas/SchemaRestrictions'
        instanceUpdate:
          description: An update of an instance document's value.
          type: object
        instanceRemove:
          description: A boolean indicating the result's value should be removed from
            the instance's document.
          type: boolean
        forceAction:
          type: boolean
          description: |
            When **true**, and **restrictions** are satisfied, the specified
            **instanceUpdate** or **instanceRemove** MUST be enforced (no silent failures).
            If **forceAction** is present, either **instanceUpdate** or **instanceRemove**
            MUST also be present.
          default: true
          example: true
      # validation logic
      anyOf:  # target or targetLocations MUST be present
        - required: [target]
        - required: [targetLocations]
      not:  # instanceUpdate and instanceRemove MUST NOT be present at the same time
        required: [instanceUpdate, instanceRemove]
      # When forceAction is present, instanceUpdate or instanceRemove MUST be present
      oneOf:
        # Case A: forceAction is *not* present (nothing else enforced)
        - not:
            required: [forceAction]
        # Case B: forceAction *is* present, and exactly one payload must accompany it
        - allOf:
            - required: [forceAction]
            - oneOf:
                - required: [instanceUpdate]
                - required: [instanceRemove]
    InstanceLocation:
      description: |
        A location in the JSON document that is an instance of an OpenAPI Schema.
        It provides an optional endpoint to restrict it as well as the location.
        All strings follow a Open API Runtime Expression or JSON Pointer (RFC 6901) format.
      type: object
      properties:
        endpoint:
          description: Optional endpoint path of a URI that MUST be present in the
            request/response.
          allOf:
            - $ref: '#/components/schemas/InstanceLocationSyntax'
        location:
          description: The location of the target result.
          allOf:
            - $ref: '#/components/schemas/InstanceLocationSyntax'
      additionalProperties: false
      required: [location]
    InstanceLocationSyntax:
      description: A string whose format is Open API Runtime Expression or JSON Path.
      type: string
      minLength: 1
      oneOf:
        - x-camara-targetSyntax: runtimeexpression  # runtime expression
          pattern: ^\$(?:url|method|statusCode|request\.(?:header\.[!#$%&'*+\-\.\^_`|~0-9A-Za-z]+|query\.[^\s\/]+|path\.[^\s\/]+|body(?:#\/(?:[^\/~]|~0|~1)+(?:\/(?:[^\/~]|~0|~1)+)*)?)|response\.(?:header\.[!#$%&'*+\-\.\^_`|~0-9A-Za-z]+|body(?:#\/(?:[^\/~]|~0|~1)+(?:\/(?:[^\/~]|~0|~1)+)*)?))
          minLength: 1
        - x-camara-targetSyntax: jsonPointer  # JSON Pointer
          pattern: ^(/([^/~]|~[01])*)*$
          minLength: 1
    SchemaRestrictions:
      description: |
        A set of schema constraints evaluated against a single target.
        - **restrictions** - An array (min = 1) of `SchemaRestriction` objects.
          Each restriction returns a Boolean result when applied to the target.
        - **operator** - Optional logical operator that combines the restriction
          results. Supported values are: **and** (default), **or**, **not**.
          When a single restrictions is supplied, **not** negates that result.
        If `operator` is omitted, **and** is assumed.
        If only one restriction is present, `operator: not` will negate it. Values of `operator: and` and
        `operator: or` are ignored.
        If `operator` is present, `restrictions` **MUST** also be present.
      type: object
      properties:
        restrictions:
          description: An array of `SchemaRestriction` objects.
          type: array
          minItems: 1
          uniqueItems: true
          items:
            $ref: '#/components/schemas/SchemaRestriction'
        operator:
          description: |
            Logical operator that combines the results of all restrictions.
            - **and** - All restrictions MUST be true.
            - **or** - At least one restriction MUST be true.
            - **not** - No restriction MAY be true.  For a single restriction this simply negates the result.
          type: string
          enum: [and, or, not]
          default: and
      required: [restrictions]
    SchemaRestriction:
      description: |
        Single schema update that refines and restricts the target.
        This update **MUST** be compatible with the referenced target.
      type: object
      anyOf:
        - $ref: '#/components/schemas/SchemaRestrictionMeta'
        - $ref: '#/components/schemas/SchemaRestrictionAnyInstance'
        - $ref: '#/components/schemas/SchemaRestrictionNumeric'
        - $ref: '#/components/schemas/SchemaRestrictionString'
        - $ref: '#/components/schemas/SchemaRestrictionArray'
        - $ref: '#/components/schemas/SchemaRestrictionObject'
        - $ref: '#/components/schemas/SchemaRestrictionParameter'
        - $ref: '#/components/schemas/SchemaRestrictionOperation'
        - $ref: '#/components/schemas/SchemaRestrictionPresence'
    SchemaRestrictionMeta:
      type: object
      description: >
        Restriction applicable to any target at runtime.
        Based upon the JSON Schema   [A Vocabulary for Basic Meta-Data Annotations](https://www.ietf.org/archive/id/draft-bhutton-json-schema-validation-01.html#name-a-vocabulary-for-basic-meta).
      additionalProperties: false
      properties:
        deprecated: {type: boolean, description: Mark as deprecated.}
        readOnly: {type: boolean, description: Mark as read-only.}
        writeOnly: {type: boolean, description: Mark as write-only.}
        default: {type: string, description: Default value to apply.}
    SchemaRestrictionAnyInstance:
      type: object
      description: >
        Restriction applicable to any target at runtime.
        Based upon the JSON Schema   [Validation keywords for Any instances](https://www.ietf.org/archive/id/draft-bhutton-json-schema-validation-01.html#name-validation-keywords-for-any).
          additionalProperties: false
      properties:
        type:
          type: string
          enum: [boolean, object, array, number, string, integer]
          nullable: true
          description: >
            Restrict the type of the value. Only applicable when the type was
            not initially specified or matches the target's current type.
        enum:
          type: array
          items: {type: string}
          description: Restrict allowed values (must be a subset of the original enum).
        const:
          type: string
          description: Force the field to have a constant value.
    SchemaRestrictionNumeric:
      type: object
      description: >
        Restriction applicable to numeric ranges (for example min/max values).
        Based upon the JSON Schema   [Validation keywords for Numeric Instances](https://www.ietf.org/archive/id/draft-bhutton-json-schema-validation-01.html#name-validation-keywords-for-num).
      additionalProperties: false
      properties:
        multipleOf: {type: number, minimum: 1, description: Value MUST be a multiple
            of this number.}
        maximum: {type: number, description: Value MUST be less than or equal to this
            number.}
        minimum: {type: number, description: Value MUST be greater than or equal to
            this number.}
        exclusiveMaximum: {type: number, description: Value MUST be strictly less
            than this number.}
        exclusiveMinimum: {type: number, description: Value MUST be strictly greater
            than this number.}
    SchemaRestrictionString:
      type: object
      description: >
        Restriction applicable to string fields (length or pattern).
        Based upon the JSON Schema   [Validation keywords for Strings](https://www.ietf.org/archive/id/draft-bhutton-json-schema-validation-01.html#name-validation-keywords-for-str).
      additionalProperties: false
      properties:
        maxLength: {type: integer, minimum: 0, description: Maximum string length.}
        minLength: {type: integer, minimum: 0, description: Minimum string length.}
        pattern: {type: string, description: Regular-expression pattern the string
            MUST match.}
    SchemaRestrictionArray:
      type: object
      description: >
        Restriction applicable to arrays (size or uniqueness).
        Based upon the JSON Schema   [Validation keywords for Array Instances](https://www.ietf.org/archive/id/draft-bhutton-json-schema-validation-01.html#name-validation-keywords-for-arr).
      additionalProperties: false
      properties:
        maxItems: {type: integer, minimum: 0, description: Maximum number of items.}
        minItems: {type: integer, minimum: 0, description: Minimum number of items.}
        uniqueItems: {type: boolean, description: 'If **true**, all items MUST be
            unique.'}
        maxContains: {type: integer, minimum: 0, description: Maximum count for items
            that match the `contains` schema.}
        minContains: {type: integer, minimum: 0, description: Minimum count for items
            that match the `contains` schema.}
    SchemaRestrictionObject:
      type: object
      description: >
        Restriction applicable to object structures.
        Based upon the JSON Schema   [Validation keywords for Object Instances](https://www.ietf.org/archive/id/draft-bhutton-json-schema-validation-01.html#name-validation-keywords-for-obj).
      additionalProperties: false
      properties:
        maxProperties: {type: integer, minimum: 0, description: Maximum number of
            object properties.}
        minProperties: {type: integer, minimum: 0, description: Minimum number of
            object properties.}
        required:
          type: array
          items: {type: string}
          description: List of required properties (MUST already exist in the schema).
        dependentRequired:
          type: array
          items: {type: string}
          description: '[`dependentRequired`](https://json-schema.org/draft/2020-12/json-schema-validation#name-validation-keywords-for-obj)'
        excludedProperties:
          type: array
          items: {type: string}
          description: Properties that MUST be absent.
    SchemaRestrictionParameter:
      type: object
      description: >
        Restriction that applies only to HTTP request parameters (e.g. query
        parameters).
        Based upon the OpenAPI *Parameter Object* and provides:
        - Mandating the use of an optional parameter   - Allowing empty values
      additionalProperties: false
      properties:
        allowEmptyValue:
          type: boolean
          description: >
            Permits empty values. MAY be **true** only if the original schema
            did not explicitly specify `allowEmptyValue: false`.
        mandatory:
          type: boolean
          description: >
            Mandates the use of an otherwise-optional parameter. Allowed only
            when:   1. The original schema does **not** declare `deprecated: true`,
            and   2. The original schema does **not** set `mandatory` to the opposite
            value.
    SchemaRestrictionOperation:
      type: object
      description: >
        Restriction that applies to an absolute or relative path (operation).
        Based upon the OpenAPI *Operation Object* and provides:
        - `notImplemented`   - `notAvailable`
      additionalProperties: false
      properties:
        notImplemented:
          type: boolean
          description: Marks the operation as unimplemented. Invocation MUST return
            **501 Not Implemented**.
        notAvailable:
          type: boolean
          description: Marks the operation as temporarily unavailable. Invocation
            MUST return **503 Service Unavailable**.
    SchemaRestrictionPresence:
      type: object
      description: >
        Restriction that applies to runtime presence of the target.
      properties:
        presence:
          type: boolean
          description: >
            When **true**, at least one instance matching the target JSON Pointer
            or JSON Path **MUST** be present.   When **false**, no such instance **MAY**
            be present.
    SchemaRestrictionsSet:
      description: Base restriction type
      type: object
      allOf:
        - $ref: '#/components/schemas/VersionedName'
      properties:
        restrictions:
          description: restrictions
          type: array
          uniqueItems: true
          minItems: 1
          maxItems: 10
          items:
            $ref: '#/components/schemas/CamaraOverlay'
        footprints:
          description: footprints
          type: array
          uniqueItems: true
          minItems: 1
          maxItems: 10
          items:
            $ref: '#/components/schemas/Footprint'
        resourceServers:
          description: resourceServers
          type: array
          uniqueItems: true  # no duplicates
          maxItems: 10
          items:
            type: string
            format: uri  # ensures each locator is a valid URI
      required: [restrictions]

    # Camara capability structures
    CapabilityBitmap:
      description: Common attributes of CAMARA capability bitmap
      type: object
      allOf:
        - $ref: '#/components/schemas/CamaraCapabilityQuery'
      properties:
        mappingVersion:
          type: string
          description: Version of the capability to restriction mapping, used to detect
            changes.
          example: 1.0.0
        camaraCapabilitiesBitmap:
          description: |
            Bitmap value of the capabilities to show current state (active or inactive) of the RestrictionSet.
            Decimal representation of a binary bitmask indicating active capabilities.
            This integer should be interpreted as a binary string (bitfield), where:
            - The **least significant bit (rightmost bit)** corresponds to key **"0"** in the `bitmapCapabilities` object.
            - The next bit to the left corresponds to key **"1"**, and so on.
            - Bit at position `n` (counting from right, 0-based) maps to key `"n"`.
            For example:
            - If `CapabilityBitmap` = `13`, the binary form is `1101`.
            - Interpreted as:
                - Bit 0 (LSB, rightmost) → "0" → active
                - Bit 1 → "1" → inactive
                - Bit 2 → "2" → active
                - Bit 3 (MSB) → "3" → active
            - This means `bitmapCapabilities["0"]`, `["2"]`, and `["3"]` apply.
            Implementors of API provider should preserve this bit order when interpreting or generating the bitmask, so that capability indices remain consistent over time.
          type: integer
          minimum: 0
          format: int64
          maximum: 18446744073709551615
          example: 6
      required: [mappingVersion, camaraCapabilitiesBitmap]
    CapabilityInfo:
      description: A list of CapabilityDetail.
      type: object
      properties:
        details:
          description: a list of CapabilityDetail.
          type: array
          minItems: 1
          maxItems: 1000  # DoS guard rail
          uniqueItems: true
          items:
            $ref: '#/components/schemas/CapabilityDetail'
    CapabilityDetail:
      description: |
        A self-contained snapshot of what each capability means (CapabilityBitmap) and its current active/inactive state.
        When these are CapabilitySetFootprint the state is always active.
        When it is CapabilitySetBitmap, then CapabilityBitmap is included that conveys the active/inactive state of each
        bit position.
      type: object
      anyOf:
        - $ref: '#/components/schemas/CapabilitySetFootprint'
        - allOf:
            - $ref: '#/components/schemas/CapabilitySetBitmap'
            - $ref: '#/components/schemas/CapabilityBitmap'
      minProperties: 1
    CapabilitySetFootprint:
      description: |
        Associates a capability with one or more RestrictionSets that
        defined by footprint constraints.
      type: object
      additionalProperties: false  # reject typos / undocumented fields
      allOf:
        - $ref: '#/components/schemas/VersionedName'
        - $ref: '#/components/schemas/Metadata'
      properties:
        footprints:
          description: An array of restrictions that apply when the endpoint is present
            in one of the entry's footprints.
          type: array
          minItems: 1
          maxItems: 64
          uniqueItems: true
          items:
            allOf:
              - $ref: '#/components/schemas/SchemaRestrictionsSet'
              - required: [footprints]
      required: [footprints]
    CapabilitySetBitmap:
      description: |
        Associates a capability with one or more RestrictionSets
        define through a bitmap position.
      type: object
      allOf:
        - $ref: '#/components/schemas/VersionedName'
        - $ref: '#/components/schemas/Metadata'
      properties:
        bitmapCapabilities:
          type: object
          description: >
            Map of bitPosition → SchemaRestrictionsSet.   Keys are stringified bitPosition
            indices (duplicates impossible).   **Header names (object keys)** SHOULD
            consist of one or more digits, matching `^[0-9]+$`.   (Note: OpenAPI 3.0.3
            cannot enforce key-name patterns natively.)
          additionalProperties:
            $ref: '#/components/schemas/SchemaRestrictionsSet'
      required: [bitmapCapabilities]

    # API related information
    CamaraCapabilityQueryRequest:
      description: A list of queries in the request.
      type: object
      additionalProperties: true
      properties:
        queries:
          description: A list of CamaraCapabilityQuery
          type: array
          minItems: 1
          maxItems: 100  # DoS guard rail
          uniqueItems: true
          items:
            $ref: '#/components/schemas/CamaraCapabilityQuery'
        subscriptionRequest:
          $ref: '#/components/schemas/CamaraExtendedSubscriptionRequest'
      required: [queries]
    CamaraCapabilityQuery:
      description: Common attributes of CAMARA capability query
      type: object
      properties:
        resourceScopes:
          $ref: '#/components/schemas/ResourceScopes'
        overlayExtends:
          description: list of unique overlay extends in the query
          type: array
          minItems: 1
          maxItems: 20  # DoS guard rail
          uniqueItems: true
          items:
            $ref: '#/components/schemas/Extends'
      required: [overlayExtends]
    ResourceScopes:
      $ref: ../common/CAMARA_common.yaml#/components/schemas/ResourceScopes
    ErrorInfo:
      $ref: ../common/CAMARA_common.yaml#/components/schemas/ErrorInfo

    # Event structures
    CamaraExtendedSubscriptionRequest:
      $ref: ../common/CAMARA-subscriptions-openapi.yaml#/components/schemas/CamaraExtendedSubscriptionRequest
    org.camaraproject.capability.v0.detail:
      description: The detail of the requested capability event subscription.
      type: object
      allOf:
        - $ref: ../common/CAMARA-subscriptions-openapi.yaml#/components/schemas/SubscriptionDetail
        - type: object
          properties:
            resourceScopes:
              $ref: '#/components/schemas/ResourceScopes'
          additionalProperties: false
    CloudEvent:
      $ref: ../common/CAMARA-subscriptions-openapi.yaml#/components/schemas/CamaraExtendedCloudEventsAttribute
    CloudEventData:
      $ref: ../common/CAMARA-subscriptions-openapi.yaml#/components/schemas/CamaraCloudEventData
    org.camaraproject.capability.v0.capability-bitmap-changed:
      description: Event structure for capability bitmap changed
      allOf:
        - $ref: '#/components/schemas/CloudEvent'
        - type: object
          properties:
            data:
              $ref: '#/components/schemas/org.camaraproject.capability.v0.capability-bitmap-changed.data'
          required: [data]
          additionalProperties: false
      example:
        $ref: '#/components/examples/EVENT_CAPABILITY_BITMAP_CHANGED_EXAMPLE/value'
    org.camaraproject.capability.v0.capability-bitmap-changed.data:
      description: Event for capability bitmap changed
      allOf:
        - $ref: '#/components/schemas/CloudEventData'
        - type: object
          properties:
            capabilityBitmap:
              $ref: '#/components/schemas/CapabilityBitmap'
          required: [capabilityBitmap]
          additionalProperties: false
    org.camaraproject.capability.v0.capability-info-changed:
      description: Event structure for capability info changed
      allOf:
        - $ref: '#/components/schemas/CloudEvent'
        - type: object
          properties:
            data:
              $ref: '#/components/schemas/org.camaraproject.capability.v0.capability-info-changed.data'
          required: [data]
          additionalProperties: false
      example:
        $ref: '#/components/examples/EVENT_CAPABILITY_INFO_CHANGED_EXAMPLE/value'
    org.camaraproject.capability.v0.capability-info-changed.data:
      description: Event for capability info changed
      allOf:
        - $ref: '#/components/schemas/CloudEventData'
        - type: object
          properties:
            capabilityInfo:
              $ref: '#/components/schemas/CapabilityInfo'
          required: [capabilityInfo]
          additionalProperties: false
  responses:
    CapabilityNotModified304:
      description: Not Modified (cached response)
      headers:
        x-correlator:
          $ref: '#/components/headers/x-correlator'
    Generic400:
      $ref: ../common/CAMARA_common.yaml#/components/responses/Generic400
    CapabilityApiBadRequest400:
      description: Bad Request when query capability
      headers:
        x-correlator:
          $ref: '#/components/headers/x-correlator'
      content:
        application/json:
          schema:
            title: CapabilityApiBadRequest400
            allOf:
              - $ref: '#/components/schemas/ErrorInfo'
              - type: object
                properties:
                  status:
                    enum: [400]
                  code:
                    enum:
                      - INVALID_ARGUMENT
                      - OUT_OF_RANGE
                      - INVALID_CREDENTIAL
                      - INVALID_TOKEN
          examples:
            GENERIC_400_INVALID_ARGUMENT:
              description: Invalid Argument. Generic Syntax Exception
              value:
                status: 400
                code: INVALID_ARGUMENT
                message: Client specified an invalid argument, request body or query
                  param.
            GENERIC_400_OUT_OF_RANGE:
              description: Out of Range. Specific Syntax Exception used when a given
                field has a pre-defined range or a invalid filter criteria combination
                is requested
              value:
                status: 400
                code: OUT_OF_RANGE
                message: Client specified an invalid range.
            GENERIC_400_INVALID_CREDENTIAL:
              value:
                status: 400
                code: INVALID_CREDENTIAL
                message: Only Access token is supported
            GENERIC_400_INVALID_TOKEN:
              value:
                status: 400
                code: INVALID_TOKEN
                message: Only bearer token is supported
    Generic401:
      $ref: ../common/CAMARA_common.yaml#/components/responses/Generic401
    Generic403:
      $ref: ../common/CAMARA_common.yaml#/components/responses/Generic403
    Generic404:
      $ref: ../common/CAMARA_common.yaml#/components/responses/Generic404
    CapabilityApiNotFound404:
      description: Capability API not found
      content:
        application/json:
          schema:
            title: CapabilityApiNotFound404
            allOf:
              - $ref: '#/components/schemas/ErrorInfo'
              - type: object
                properties:
                  status:
                    enum: [404]
                  code:
                    enum: [NOT_FOUND]
          example:
            status: 404
            code: NOT_FOUND
            message: No Capability API found
    Generic409:
      $ref: ../common/CAMARA_common.yaml#/components/responses/Generic409
    Generic410:
      $ref: ../common/CAMARA_common.yaml#/components/responses/Generic410
    Generic429:
      $ref: ../common/CAMARA_common.yaml#/components/responses/Generic429
    Generic500:
      $ref: ../common/CAMARA_common.yaml#/components/responses/Generic500
    Generic503:
      $ref: ../common/CAMARA_common.yaml#/components/responses/Generic503
  examples:
    CAMARA_CAPABILITY_QUERY_REQUEST_EXAMPLE:
      summary: Example of capability query
      description: query capability request
      value:
        queries:
          - resourceScopes:
              - phoneNumber: '+123456788'
            overlayExtends:
              - https://github.com/camaraproject/QualityOnDemand/blob/r2.2/code/API_definitions/quality-on-demand.yaml
              - https://github.com/camaraproject/QualityOnDemand/blob/r2.2/code/API_definitions/qos-profiles.yaml
            subscriptionRequest:
              sink: https://application-server.com/notifications
              protocol: HTTP
              types:
                - org.camaraproject.capability.v0.capability-info-changed
                - org.camaraproject.capability.v0.capability-bitmap-changed
              config:
                subscriptionDetail:
                  resourceScopes:
                    - phoneNumber: '+123456788'
    CAMARA_CAPABILITY_QUERY_REQUEST_RESPONSE_EXAMPLE:
      summary: Example of capability query response
      description: query capability response
      value:
        details:
          - name: cap-qod-adi
            version: 1.0.1
            createdAt: '2025-05-09T14:25:38Z'
            overlayExtends:
              - https://github.com/camaraproject/QualityOnDemand/blob/r2.2/code/API_definitions/quality-on-demand.yaml
              - https://github.com/camaraproject/QualityOnDemand/blob/r2.2/code/API_definitions/qos-profiles.yaml
            resourceScopes:
              - phoneNumber: '+123456788'
            mappingVersion: 1.0.0
            camaraCapabilitiesBitmap: 63
            bitmapCapabilities:
              '0':
                name: rr-qod-adi
                version: 1.0.1
                restrictions:
                  - name: org.camaraproject.capability.v0.object-instance-restriction.accepted-device-identifiers
                    version: 0.0.1
                    extends: https://github.com/camaraproject/QualityOnDemand/blob/r2.2/code/API_definitions/quality-on-demand.yaml
                    actions:
                      - target: $.components.schemas['Device'].properties['ipv4Address']
                        remove: true
                      - target: $.components.schemas['Device'].properties['networkAccessIdentifier']
                        remove: true
              '1':
                name: rr-qod-xcor
                version: 1.0.1
                restrictions:
                  - name: org.camaraproject.capability.v0.parameter-restriction.x-cor-required
                    version: 0.0.1
                    extends: https://github.com/camaraproject/QualityOnDemand/blob/r2.2/code/API_definitions/quality-on-demand.yaml
                    actions:
                      - target: $.components.parameters['x-correlator']
                        update:
                          xcor-required:
                            restrictions:
                              - mandatory: true
              '2':
                name: rr-session-extend-unavailable
                version: 1.0.1
                restrictions:
                  - name: org.camaraproject.capability.v0.operation-restriction.session-extend-unavailable
                    version: 0.0.1
                    extends: https://github.com/camaraproject/QualityOnDemand/blob/r2.2/code/API_definitions/quality-on-demand.yaml
                    actions:
                      - target: $.paths['/sessions/{sessionId}/extend'].post
                        update:
                          session-extend-unavailable:
                            restrictions:
                              - notAvailable: true
              '3':
                name: rr-session-accept-qos
                version: 1.0.1
                restrictions:
                  - name: org.camaraproject.capability.v0.enum-restriction.accepted-qos-profiles
                    version: 0.0.1
                    extends: https://github.com/camaraproject/QualityOnDemand/blob/r2.2/code/API_definitions/quality-on-demand.yaml
                    operator: and
                    actions:
                      - targetLocations:
                          - location: $method
                        update:
                          accepted-qos-profiles:
                            restrictions:
                              - enum: [POST]
                      - targetLocations:
                          - location: $request.path.sessionId
                        update:
                          accepted-qos-profiles:
                            restrictions:
                              - enum: [/sessions]
                      - targetLocations:
                          - location: $request.body#/qosProfile
                        update:
                          accepted-qos-profiles:
                            restrictions:
                              - enum: [QoS_XR, QoS_VC]
              '4':
                name: rr-ipv6-portspec-max-5
                version: 1.0.1
                restrictions:
                  - name: org.camaraproject.capability.v0.object-instance-restriction.appserv-ipv6
                    version: 1.0.1
                    extends: https://github.com/camaraproject/QualityOnDemand/blob/r2.2/code/API_definitions/quality-on-demand.yaml
                    actions:
                      - target: $.components.schemas['ApplicationServer'].properties['ipv4Address']
                        remove: true
                  - name: org.camaraproject.capability.v0.array-size-restriction.portspec-ports-max5
                    version: 1.0.1
                    extends: https://github.com/camaraproject/QualityOnDemand/blob/r2.2/code/API_definitions/quality-on-demand.yaml
                    actions:
                      - target: $.components.schemas['PortsSpec'].properties['ports']
                        update:
                          portspec-ports-max5:
                            restrictions:
                              - maxItems: 5
              '5':
                name: rr-sessioninfo-duration-multipleof-60
                version: 1.0.1
                restrictions:
                  - name: org.camaraproject.capability.v0.numeric-restriction.sessioninfo-duration-min60-multiple60
                    version: 1.0.1
                    extends: https://github.com/camaraproject/QualityOnDemand/blob/r2.2/code/API_definitions/quality-on-demand.yaml
                    actions:
                      - target: $.components.schemas['SessionInfo'].properties['duration']
                        update:
                          sessioninfo-duration-min60-multiple60:
                            restrictions:
                              - minimum: 60
                              - multipleOf: 60
              '6':
                name: rr-qosprofile-get-unavailable
                version: 1.0.1
                restrictions:
                  - name: org.camaraproject.capability.v0.operation-restriction.qosprofile-get-unavailable
                    version: 1.0.1
                    extends: https://github.com/camaraproject/QualityOnDemand/blob/r2.2/code/API_definitions/qos-profiles.yaml
                    actions:
                      - target: $.paths['/qos-profiles/{name}'].get
                        remove: true
    EVENT_CAPABILITY_BITMAP_CHANGED_EXAMPLE:
      summary: Cloud event example for capability bitmap changed
      description: Cloud event example for capability bitmap changed
      value:
        id: cb1
        source: https://api.example.com/capability/capability-subscriptions/bitmap
        datacontenttype: application/json
        specversion: '1.0'
        type: org.camaraproject.capability.v0.capability-bitmap-changed
        time: '2025-05-06T00:00:00.000Z'
        data:
          capabilityBitmap:
            resourceScopes:
              - phoneNumber: '+123456788'
            overlayExtends:
              - https://github.com/camaraproject/QualityOnDemand/blob/r2.2/code/API_definitions/quality-on-demand.yaml
              - https://github.com/camaraproject/QualityOnDemand/blob/r2.2/code/API_definitions/qos-profiles.yaml
            mappingVersion: 1.0.0
            camaraCapabilitiesBitmap: 127
    EVENT_CAPABILITY_BITMAP_CHANGED_BATCH_EXAMPLE:
      summary: Batch (single item) - capability bitmap changed
      description: Cloud event batch example for capability bitmap changed
      value:
        - id: cb1
          source: https://api.example.com/capability/capability-subscriptions/bitmap
          datacontenttype: application/json
          specversion: '1.0'
          type: org.camaraproject.capability.v0.capability-bitmap-changed
          time: '2025-05-06T00:00:00.000Z'
          data:
            capabilityBitmap:
              resourceScopes:
                - phoneNumber: '+123456788'
              overlayExtends:
                - https://github.com/camaraproject/QualityOnDemand/blob/r2.2/code/API_definitions/quality-on-demand.yaml
                - https://github.com/camaraproject/QualityOnDemand/blob/r2.2/code/API_definitions/qos-profiles.yaml
              mappingVersion: 1.0.0
              camaraCapabilitiesBitmap: 127
    EVENT_CAPABILITY_INFO_CHANGED_EXAMPLE:
      description: Cloud event example for capability info changed
      value:
        id: ci1
        source: https://api.example.com/capability/capability-subscriptions/info
        specversion: '1.0'
        datacontenttype: application/json
        type: org.camaraproject.capability.v0.capability-info-changed
        time: '2025-05-06T00:00:00.000Z'
        data:
          capabilityInfo:
            details:
              - name: cap-qod-adi
                version: 1.0.2
                createdAt: '2025-05-09T14:25:38Z'
                overlayExtends:
                  - https://github.com/camaraproject/QualityOnDemand/blob/r2.2/code/API_definitions/quality-on-demand.yaml
                  - https://github.com/camaraproject/QualityOnDemand/blob/r2.2/code/API_definitions/qos-profiles.yaml
                resourceScopes:
                  - phoneNumber: '+123456788'
                mappingVersion: 1.0.0
                camaraCapabilitiesBitmap: 1
                bitmapCapabilities:
                  '0':
                    name: rr-qod-adi
                    version: 1.0.1
                    restrictions:
                      - name: org.camaraproject.capability.v0.object-instance-restriction.accepted-device-identifiers
                        version: 1.0.1
                        extends: https://github.com/camaraproject/QualityOnDemand/blob/r2.2/code/API_definitions/quality-on-demand.yaml
                        actions:
                          - target: $.components.schemas['Device'].properties['ipv4Address']
                            remove: true
                          - target: $.components.schemas['Device'].properties['networkAccessIdentifier']
                            remove: true
    EVENT_CAPABILITY_INFO_CHANGED_BATCH_EXAMPLE:
      summary: Batch (single item) - capability info changed
      description: Cloud event batch example for capability info changed
      value:
        - id: ci1
          source: https://api.example.com/capability/capability-subscriptions/info
          specversion: '1.0'
          datacontenttype: application/json
          type: org.camaraproject.capability.v0.capability-info-changed
          time: '2025-05-06T00:00:00.000Z'
          data:
            capabilityInfo:
              details:
                - name: cap-qod-adi
                  version: 1.0.2
                  createdAt: '2025-05-09T14:25:38Z'
                  overlayExtends:
                    - https://github.com/camaraproject/QualityOnDemand/blob/r2.2/code/API_definitions/quality-on-demand.yaml
                    - https://github.com/camaraproject/QualityOnDemand/blob/r2.2/code/API_definitions/qos-profiles.yaml
                  resourceScopes:
                    - phoneNumber: '+123456788'
                  mappingVersion: 1.0.0
                  camaraCapabilitiesBitmap: 1
                  bitmapCapabilities:
                    '0':
                      name: rr-qod-adi
                      version: 1.0.1
                      restrictions:
                        - name: org.camaraproject.capability.v0.object-instance-restriction.accepted-device-identifiers
                          version: 1.0.1
                          extends: https://github.com/camaraproject/QualityOnDemand/blob/r2.2/code/API_definitions/quality-on-demand.yaml
                          actions:
                            - target: $.components.schemas['Device'].properties['ipv4Address']
                              remove: true
                            - target: $.components.schemas['Device'].properties['networkAccessIdentifier']
                              remove: true
```