Skip to content

Commit

Permalink
FIx FAQ line-endings (#294)
Browse files Browse the repository at this point in the history
and recommend tool for auto-update of ToC
  • Loading branch information
ralfhandl authored Apr 18, 2024
1 parent 78b1edf commit 49062ca
Show file tree
Hide file tree
Showing 2 changed files with 139 additions and 142 deletions.
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"hbenl.vscode-mocha-test-adapter",
"hbenl.vscode-test-explorer",
"redhat.vscode-xml",
"streetsidesoftware.code-spell-checker"
"streetsidesoftware.code-spell-checker",
"yzhang.markdown-all-in-one"
]
}
278 changes: 137 additions & 141 deletions doc/FAQ.md
Original file line number Diff line number Diff line change
@@ -1,141 +1,137 @@
# Frequently Asked Questions

Examples for typical questions on how to fine-tune the generated OpenAPI descriptions.

The examples here do not cover the full list of [supported annotions](Annotations.md).

<!-- TOC depthfrom:2 -->

- [How to suppress GET list and by-key on an entity set?](#how-to-suppress-get-list-and-by-key-on-an-entity-set)
- [How to suppress GET list on an entity set?](#how-to-suppress-get-list-on-an-entity-set)
- [How to suppress GET by-key on an entity set?](#how-to-suppress-get-by-key-on-an-entity-set)
- [How to suppress GET and POST along all navigation properties?](#how-to-suppress-get-and-post-along-all-navigation-properties)
- [How to suppress GET and POST along a specific navigation property?](#how-to-suppress-get-and-post-along-a-specific-navigation-property)
- [How to suppress GET along a specific navigation property?](#how-to-suppress-get-along-a-specific-navigation-property)
- [How to suppress POST along a specific navigation property?](#how-to-suppress-post-along-a-specific-navigation-property)
- [Can I have multiple NavigationRestrictions annotations for the same entity set?](#can-i-have-multiple-navigationrestrictions-annotations-for-the-same-entity-set)
- [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)

<!-- /TOC -->

## How to suppress GET (list and by-key) on an entity set?

To suppress both types of GET requests to an entity set, annotate it with

```xml
<Annotation Term="Capabilities.ReadRestrictions">
<Record>
<PropertyValue Property="Readable" Bool="false" />
</Record>
</Annotation>
```

## How to suppress GET (list) on an entity set?

To suppress only GET list requests to an entity set and still allow GET by-key, annotate it with

```xml
<Annotation Term="Capabilities.ReadRestrictions">
<Record>
<PropertyValue Property="Readable" Bool="false" />
<PropertyValue Property="ReadByKeyRestrictions">
<Record>
<PropertyValue Property="Readable" Bool="true" />
</Record>
</PropertyValue>
</Record>
</Annotation>
```

## How to suppress GET (by-key) on an entity set?

To suppress only GET by-key requests to an entity set and still allow GET list, annotate it with

```xml
<Annotation Term="Capabilities.ReadRestrictions">
<Record>
<PropertyValue Property="ReadByKeyRestrictions">
<Record>
<PropertyValue Property="Readable" Bool="false" />
</Record>
</PropertyValue>
</Record>
</Annotation>
```

## How to suppress GET and POST along all navigation properties?

```xml
<Annotation Term="Capabilities.NavigationRestrictions">
<Record>
<PropertyValue Property="Navigability" EnumMember="Capabilities.NavigationType/None" />
</Record>
</Annotation>
```

## How to suppress GET and POST along a specific navigation property?

```xml
<Annotation Term="Capabilities.NavigationRestrictions">
<Record>
<PropertyValue Property="RestrictedProperties">
<Collection>
<Record>
<PropertyValue Property="NavigationProperty" NavigationPropertyPath="Foo" />
<PropertyValue Property="Navigability" EnumMember="Capabilities.NavigationType/None" />
</Record>
</Collection>
</PropertyValue>
</Record>
</Annotation>
```

## How to suppress GET along a specific navigation property?

```xml
<Annotation Term="Capabilities.NavigationRestrictions">
<Record>
<PropertyValue Property="RestrictedProperties">
<Collection>
<Record>
<PropertyValue Property="NavigationProperty" NavigationPropertyPath="Foo" />
<PropertyValue Property="ReadRestrictions">
<Record>
<PropertyValue Property="Readable" Bool="false" />
</Record>
</PropertyValue>
</Record>
</Collection>
</PropertyValue>
</Record>
</Annotation>
```

## How to suppress POST along a specific navigation property?

```xml
<Annotation Term="Capabilities.NavigationRestrictions">
<Record>
<PropertyValue Property="RestrictedProperties">
<Collection>
<Record>
<PropertyValue Property="NavigationProperty" NavigationPropertyPath="Foo" />
<PropertyValue Property="InsertRestrictions">
<Record>
<PropertyValue Property="Insertable" Bool="false" />
</Record>
</PropertyValue>
</Record>
</Collection>
</PropertyValue>
</Record>
</Annotation>
```

## Can I have multiple `NavigationRestrictions` annotations for the same entity set?

No, you have to combine all restrictions for an entity set into a single annotation with term `Capabilities.NavigationRestrictions`.

## Can I have multiple records for the same navigation property in the `RestrictedProperties` collection?

No, you have to combine all restrictions for a navigation proeprty into a single record.
# Frequently Asked Questions <!-- omit in toc -->

Examples for typical questions on how to fine-tune the generated OpenAPI descriptions.

The examples here do not cover the full list of [supported annotions](Annotations.md).

- [How to suppress GET (list and by-key) on an entity set?](#how-to-suppress-get-list-and-by-key-on-an-entity-set)
- [How to suppress GET (list) on an entity set?](#how-to-suppress-get-list-on-an-entity-set)
- [How to suppress GET (by-key) on an entity set?](#how-to-suppress-get-by-key-on-an-entity-set)
- [How to suppress GET and POST along all navigation properties?](#how-to-suppress-get-and-post-along-all-navigation-properties)
- [How to suppress GET and POST along a specific navigation property?](#how-to-suppress-get-and-post-along-a-specific-navigation-property)
- [How to suppress GET along a specific navigation property?](#how-to-suppress-get-along-a-specific-navigation-property)
- [How to suppress POST along a specific navigation property?](#how-to-suppress-post-along-a-specific-navigation-property)
- [Can I have multiple `NavigationRestrictions` annotations for the same entity set?](#can-i-have-multiple-navigationrestrictions-annotations-for-the-same-entity-set)
- [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)

## How to suppress GET (list and by-key) on an entity set?

To suppress both types of GET requests to an entity set, annotate it with

```xml
<Annotation Term="Capabilities.ReadRestrictions">
<Record>
<PropertyValue Property="Readable" Bool="false" />
</Record>
</Annotation>
```

## How to suppress GET (list) on an entity set?

To suppress only GET list requests to an entity set and still allow GET by-key, annotate it with

```xml
<Annotation Term="Capabilities.ReadRestrictions">
<Record>
<PropertyValue Property="Readable" Bool="false" />
<PropertyValue Property="ReadByKeyRestrictions">
<Record>
<PropertyValue Property="Readable" Bool="true" />
</Record>
</PropertyValue>
</Record>
</Annotation>
```

## How to suppress GET (by-key) on an entity set?

To suppress only GET by-key requests to an entity set and still allow GET list, annotate it with

```xml
<Annotation Term="Capabilities.ReadRestrictions">
<Record>
<PropertyValue Property="ReadByKeyRestrictions">
<Record>
<PropertyValue Property="Readable" Bool="false" />
</Record>
</PropertyValue>
</Record>
</Annotation>
```

## How to suppress GET and POST along all navigation properties?

```xml
<Annotation Term="Capabilities.NavigationRestrictions">
<Record>
<PropertyValue Property="Navigability" EnumMember="Capabilities.NavigationType/None" />
</Record>
</Annotation>
```

## How to suppress GET and POST along a specific navigation property?

```xml
<Annotation Term="Capabilities.NavigationRestrictions">
<Record>
<PropertyValue Property="RestrictedProperties">
<Collection>
<Record>
<PropertyValue Property="NavigationProperty" NavigationPropertyPath="Foo" />
<PropertyValue Property="Navigability" EnumMember="Capabilities.NavigationType/None" />
</Record>
</Collection>
</PropertyValue>
</Record>
</Annotation>
```

## How to suppress GET along a specific navigation property?

```xml
<Annotation Term="Capabilities.NavigationRestrictions">
<Record>
<PropertyValue Property="RestrictedProperties">
<Collection>
<Record>
<PropertyValue Property="NavigationProperty" NavigationPropertyPath="Foo" />
<PropertyValue Property="ReadRestrictions">
<Record>
<PropertyValue Property="Readable" Bool="false" />
</Record>
</PropertyValue>
</Record>
</Collection>
</PropertyValue>
</Record>
</Annotation>
```

## How to suppress POST along a specific navigation property?

```xml
<Annotation Term="Capabilities.NavigationRestrictions">
<Record>
<PropertyValue Property="RestrictedProperties">
<Collection>
<Record>
<PropertyValue Property="NavigationProperty" NavigationPropertyPath="Foo" />
<PropertyValue Property="InsertRestrictions">
<Record>
<PropertyValue Property="Insertable" Bool="false" />
</Record>
</PropertyValue>
</Record>
</Collection>
</PropertyValue>
</Record>
</Annotation>
```

## Can I have multiple `NavigationRestrictions` annotations for the same entity set?

No, you have to combine all restrictions for an entity set into a single annotation with term `Capabilities.NavigationRestrictions`.

## Can I have multiple records for the same navigation property in the `RestrictedProperties` collection?

No, you have to combine all restrictions for a navigation proeprty into a single record.

0 comments on commit 49062ca

Please sign in to comment.