|
1 | | -# Frequently Asked Questions |
2 | | - |
3 | | -Examples for typical questions on how to fine-tune the generated OpenAPI descriptions. |
4 | | - |
5 | | -The examples here do not cover the full list of [supported annotions](Annotations.md). |
6 | | - |
7 | | -<!-- TOC depthfrom:2 --> |
8 | | - |
9 | | -- [How to suppress GET list and by-key on an entity set?](#how-to-suppress-get-list-and-by-key-on-an-entity-set) |
10 | | -- [How to suppress GET list on an entity set?](#how-to-suppress-get-list-on-an-entity-set) |
11 | | -- [How to suppress GET by-key on an entity set?](#how-to-suppress-get-by-key-on-an-entity-set) |
12 | | -- [How to suppress GET and POST along all navigation properties?](#how-to-suppress-get-and-post-along-all-navigation-properties) |
13 | | -- [How to suppress GET and POST along a specific navigation property?](#how-to-suppress-get-and-post-along-a-specific-navigation-property) |
14 | | -- [How to suppress GET along a specific navigation property?](#how-to-suppress-get-along-a-specific-navigation-property) |
15 | | -- [How to suppress POST along a specific navigation property?](#how-to-suppress-post-along-a-specific-navigation-property) |
16 | | -- [Can I have multiple NavigationRestrictions annotations for the same entity set?](#can-i-have-multiple-navigationrestrictions-annotations-for-the-same-entity-set) |
17 | | -- [Can I have multiple records for the same navigation property in the RestrictedProperties collection?](#can-i-have-multiple-records-for-the-same-navigation-property-in-the-restrictedproperties-collection) |
18 | | - |
19 | | -<!-- /TOC --> |
20 | | - |
21 | | -## How to suppress GET (list and by-key) on an entity set? |
22 | | - |
23 | | -To suppress both types of GET requests to an entity set, annotate it with |
24 | | - |
25 | | -```xml |
26 | | -<Annotation Term="Capabilities.ReadRestrictions"> |
27 | | - <Record> |
28 | | - <PropertyValue Property="Readable" Bool="false" /> |
29 | | - </Record> |
30 | | -</Annotation> |
31 | | -``` |
32 | | - |
33 | | -## How to suppress GET (list) on an entity set? |
34 | | - |
35 | | -To suppress only GET list requests to an entity set and still allow GET by-key, annotate it with |
36 | | - |
37 | | -```xml |
38 | | -<Annotation Term="Capabilities.ReadRestrictions"> |
39 | | - <Record> |
40 | | - <PropertyValue Property="Readable" Bool="false" /> |
41 | | - <PropertyValue Property="ReadByKeyRestrictions"> |
42 | | - <Record> |
43 | | - <PropertyValue Property="Readable" Bool="true" /> |
44 | | - </Record> |
45 | | - </PropertyValue> |
46 | | - </Record> |
47 | | -</Annotation> |
48 | | -``` |
49 | | - |
50 | | -## How to suppress GET (by-key) on an entity set? |
51 | | - |
52 | | -To suppress only GET by-key requests to an entity set and still allow GET list, annotate it with |
53 | | - |
54 | | -```xml |
55 | | -<Annotation Term="Capabilities.ReadRestrictions"> |
56 | | - <Record> |
57 | | - <PropertyValue Property="ReadByKeyRestrictions"> |
58 | | - <Record> |
59 | | - <PropertyValue Property="Readable" Bool="false" /> |
60 | | - </Record> |
61 | | - </PropertyValue> |
62 | | - </Record> |
63 | | -</Annotation> |
64 | | -``` |
65 | | - |
66 | | -## How to suppress GET and POST along all navigation properties? |
67 | | - |
68 | | -```xml |
69 | | -<Annotation Term="Capabilities.NavigationRestrictions"> |
70 | | - <Record> |
71 | | - <PropertyValue Property="Navigability" EnumMember="Capabilities.NavigationType/None" /> |
72 | | - </Record> |
73 | | -</Annotation> |
74 | | -``` |
75 | | - |
76 | | -## How to suppress GET and POST along a specific navigation property? |
77 | | - |
78 | | -```xml |
79 | | -<Annotation Term="Capabilities.NavigationRestrictions"> |
80 | | - <Record> |
81 | | - <PropertyValue Property="RestrictedProperties"> |
82 | | - <Collection> |
83 | | - <Record> |
84 | | - <PropertyValue Property="NavigationProperty" NavigationPropertyPath="Foo" /> |
85 | | - <PropertyValue Property="Navigability" EnumMember="Capabilities.NavigationType/None" /> |
86 | | - </Record> |
87 | | - </Collection> |
88 | | - </PropertyValue> |
89 | | - </Record> |
90 | | -</Annotation> |
91 | | -``` |
92 | | - |
93 | | -## How to suppress GET along a specific navigation property? |
94 | | - |
95 | | -```xml |
96 | | -<Annotation Term="Capabilities.NavigationRestrictions"> |
97 | | - <Record> |
98 | | - <PropertyValue Property="RestrictedProperties"> |
99 | | - <Collection> |
100 | | - <Record> |
101 | | - <PropertyValue Property="NavigationProperty" NavigationPropertyPath="Foo" /> |
102 | | - <PropertyValue Property="ReadRestrictions"> |
103 | | - <Record> |
104 | | - <PropertyValue Property="Readable" Bool="false" /> |
105 | | - </Record> |
106 | | - </PropertyValue> |
107 | | - </Record> |
108 | | - </Collection> |
109 | | - </PropertyValue> |
110 | | - </Record> |
111 | | -</Annotation> |
112 | | -``` |
113 | | - |
114 | | -## How to suppress POST along a specific navigation property? |
115 | | - |
116 | | -```xml |
117 | | -<Annotation Term="Capabilities.NavigationRestrictions"> |
118 | | - <Record> |
119 | | - <PropertyValue Property="RestrictedProperties"> |
120 | | - <Collection> |
121 | | - <Record> |
122 | | - <PropertyValue Property="NavigationProperty" NavigationPropertyPath="Foo" /> |
123 | | - <PropertyValue Property="InsertRestrictions"> |
124 | | - <Record> |
125 | | - <PropertyValue Property="Insertable" Bool="false" /> |
126 | | - </Record> |
127 | | - </PropertyValue> |
128 | | - </Record> |
129 | | - </Collection> |
130 | | - </PropertyValue> |
131 | | - </Record> |
132 | | -</Annotation> |
133 | | -``` |
134 | | - |
135 | | -## Can I have multiple `NavigationRestrictions` annotations for the same entity set? |
136 | | - |
137 | | -No, you have to combine all restrictions for an entity set into a single annotation with term `Capabilities.NavigationRestrictions`. |
138 | | - |
139 | | -## Can I have multiple records for the same navigation property in the `RestrictedProperties` collection? |
140 | | - |
141 | | -No, you have to combine all restrictions for a navigation proeprty into a single record. |
| 1 | +# Frequently Asked Questions <!-- omit in toc --> |
| 2 | + |
| 3 | +Examples for typical questions on how to fine-tune the generated OpenAPI descriptions. |
| 4 | + |
| 5 | +The examples here do not cover the full list of [supported annotions](Annotations.md). |
| 6 | + |
| 7 | +- [How to suppress GET (list and by-key) on an entity set?](#how-to-suppress-get-list-and-by-key-on-an-entity-set) |
| 8 | +- [How to suppress GET (list) on an entity set?](#how-to-suppress-get-list-on-an-entity-set) |
| 9 | +- [How to suppress GET (by-key) on an entity set?](#how-to-suppress-get-by-key-on-an-entity-set) |
| 10 | +- [How to suppress GET and POST along all navigation properties?](#how-to-suppress-get-and-post-along-all-navigation-properties) |
| 11 | +- [How to suppress GET and POST along a specific navigation property?](#how-to-suppress-get-and-post-along-a-specific-navigation-property) |
| 12 | +- [How to suppress GET along a specific navigation property?](#how-to-suppress-get-along-a-specific-navigation-property) |
| 13 | +- [How to suppress POST along a specific navigation property?](#how-to-suppress-post-along-a-specific-navigation-property) |
| 14 | +- [Can I have multiple `NavigationRestrictions` annotations for the same entity set?](#can-i-have-multiple-navigationrestrictions-annotations-for-the-same-entity-set) |
| 15 | +- [Can I have multiple records for the same navigation property in the `RestrictedProperties` collection?](#can-i-have-multiple-records-for-the-same-navigation-property-in-the-restrictedproperties-collection) |
| 16 | + |
| 17 | +## How to suppress GET (list and by-key) on an entity set? |
| 18 | + |
| 19 | +To suppress both types of GET requests to an entity set, annotate it with |
| 20 | + |
| 21 | +```xml |
| 22 | +<Annotation Term="Capabilities.ReadRestrictions"> |
| 23 | + <Record> |
| 24 | + <PropertyValue Property="Readable" Bool="false" /> |
| 25 | + </Record> |
| 26 | +</Annotation> |
| 27 | +``` |
| 28 | + |
| 29 | +## How to suppress GET (list) on an entity set? |
| 30 | + |
| 31 | +To suppress only GET list requests to an entity set and still allow GET by-key, annotate it with |
| 32 | + |
| 33 | +```xml |
| 34 | +<Annotation Term="Capabilities.ReadRestrictions"> |
| 35 | + <Record> |
| 36 | + <PropertyValue Property="Readable" Bool="false" /> |
| 37 | + <PropertyValue Property="ReadByKeyRestrictions"> |
| 38 | + <Record> |
| 39 | + <PropertyValue Property="Readable" Bool="true" /> |
| 40 | + </Record> |
| 41 | + </PropertyValue> |
| 42 | + </Record> |
| 43 | +</Annotation> |
| 44 | +``` |
| 45 | + |
| 46 | +## How to suppress GET (by-key) on an entity set? |
| 47 | + |
| 48 | +To suppress only GET by-key requests to an entity set and still allow GET list, annotate it with |
| 49 | + |
| 50 | +```xml |
| 51 | +<Annotation Term="Capabilities.ReadRestrictions"> |
| 52 | + <Record> |
| 53 | + <PropertyValue Property="ReadByKeyRestrictions"> |
| 54 | + <Record> |
| 55 | + <PropertyValue Property="Readable" Bool="false" /> |
| 56 | + </Record> |
| 57 | + </PropertyValue> |
| 58 | + </Record> |
| 59 | +</Annotation> |
| 60 | +``` |
| 61 | + |
| 62 | +## How to suppress GET and POST along all navigation properties? |
| 63 | + |
| 64 | +```xml |
| 65 | +<Annotation Term="Capabilities.NavigationRestrictions"> |
| 66 | + <Record> |
| 67 | + <PropertyValue Property="Navigability" EnumMember="Capabilities.NavigationType/None" /> |
| 68 | + </Record> |
| 69 | +</Annotation> |
| 70 | +``` |
| 71 | + |
| 72 | +## How to suppress GET and POST along a specific navigation property? |
| 73 | + |
| 74 | +```xml |
| 75 | +<Annotation Term="Capabilities.NavigationRestrictions"> |
| 76 | + <Record> |
| 77 | + <PropertyValue Property="RestrictedProperties"> |
| 78 | + <Collection> |
| 79 | + <Record> |
| 80 | + <PropertyValue Property="NavigationProperty" NavigationPropertyPath="Foo" /> |
| 81 | + <PropertyValue Property="Navigability" EnumMember="Capabilities.NavigationType/None" /> |
| 82 | + </Record> |
| 83 | + </Collection> |
| 84 | + </PropertyValue> |
| 85 | + </Record> |
| 86 | +</Annotation> |
| 87 | +``` |
| 88 | + |
| 89 | +## How to suppress GET along a specific navigation property? |
| 90 | + |
| 91 | +```xml |
| 92 | +<Annotation Term="Capabilities.NavigationRestrictions"> |
| 93 | + <Record> |
| 94 | + <PropertyValue Property="RestrictedProperties"> |
| 95 | + <Collection> |
| 96 | + <Record> |
| 97 | + <PropertyValue Property="NavigationProperty" NavigationPropertyPath="Foo" /> |
| 98 | + <PropertyValue Property="ReadRestrictions"> |
| 99 | + <Record> |
| 100 | + <PropertyValue Property="Readable" Bool="false" /> |
| 101 | + </Record> |
| 102 | + </PropertyValue> |
| 103 | + </Record> |
| 104 | + </Collection> |
| 105 | + </PropertyValue> |
| 106 | + </Record> |
| 107 | +</Annotation> |
| 108 | +``` |
| 109 | + |
| 110 | +## How to suppress POST along a specific navigation property? |
| 111 | + |
| 112 | +```xml |
| 113 | +<Annotation Term="Capabilities.NavigationRestrictions"> |
| 114 | + <Record> |
| 115 | + <PropertyValue Property="RestrictedProperties"> |
| 116 | + <Collection> |
| 117 | + <Record> |
| 118 | + <PropertyValue Property="NavigationProperty" NavigationPropertyPath="Foo" /> |
| 119 | + <PropertyValue Property="InsertRestrictions"> |
| 120 | + <Record> |
| 121 | + <PropertyValue Property="Insertable" Bool="false" /> |
| 122 | + </Record> |
| 123 | + </PropertyValue> |
| 124 | + </Record> |
| 125 | + </Collection> |
| 126 | + </PropertyValue> |
| 127 | + </Record> |
| 128 | +</Annotation> |
| 129 | +``` |
| 130 | + |
| 131 | +## Can I have multiple `NavigationRestrictions` annotations for the same entity set? |
| 132 | + |
| 133 | +No, you have to combine all restrictions for an entity set into a single annotation with term `Capabilities.NavigationRestrictions`. |
| 134 | + |
| 135 | +## Can I have multiple records for the same navigation property in the `RestrictedProperties` collection? |
| 136 | + |
| 137 | +No, you have to combine all restrictions for a navigation proeprty into a single record. |
0 commit comments