Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
predic8 committed Jan 10, 2023
2 parents 7496572 + 7134679 commit 2476b7f
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -316,4 +316,22 @@ public void setAllowedMethods(String allowedMethods) {
if (!"GET".equals(allowedMethod) && !"POST".equals(allowedMethod))
throw new InvalidParameterException("<graphQLProtectionInterceptor allowedMethods=\"...\" /> may only allow GET or POST.");
}

public int getMaxRecursion() {
return maxRecursion;
}

@MCAttribute
public void setMaxRecursion(int maxRecursion) {
this.maxRecursion = maxRecursion;
}

public int getMaxDepth() {
return maxDepth;
}

@MCAttribute
public void setMaxDepth(int maxDepth) {
this.maxDepth = maxDepth;
}
}
22 changes: 11 additions & 11 deletions distribution/examples/openapi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ An _openAPIProxy_ can be added to the _proxies.xml_ configuration file. See the
```xml
<router>
<openAPIProxy port="2000">
<spec location="fruitshop-api.yml"/>
<spec dir="openapi"/>
<spec location="https://developer.lufthansa.com/swagger/export/21516"/>
<spec location="https://api.apis.guru/v2/specs/nowpayments.io/1.0.0/openapi.json"/>
<spec location="https://raw.githubusercontent.com/openai/openai-openapi/master/openapi.yaml"/>
<openapi location="fruitshop-api.yml"/>
<openapi dir="openapi"/>
<openapi location="https://developer.lufthansa.com/swagger/export/21516"/>
<openapi location="https://api.apis.guru/v2/specs/nowpayments.io/1.0.0/openapi.json"/>
<openapi location="https://raw.githubusercontent.com/openai/openai-openapi/master/openapi.yaml"/>
</openAPIProxy>
</router>
```
Expand All @@ -49,7 +49,7 @@ It is also possilbe to configure the backend address using a [target](https://ww
```xml
<serviceProxy>
<openAPIProxy port="2000">
<spec dir="openapi"/>
<openapi dir="openapi"/>
<target host="api.predic8.de" port="8080"/>
</openAPIProxy>
</serviceProxy>
Expand All @@ -68,7 +68,7 @@ Membrane can validate requests and responses against OpenAPI definitions and che
Validation can be activated for requests and responses separatly. Set _validationDetails_ to _no_ if you do not want to send validation errors in detail to the client.

```xml
<spec location="fruitshop-api.yml"
<openapi location="fruitshop-api.yml"
validateRequests="yes"
validateResponses="yes"
validationDetails="yes"/>
Expand Down Expand Up @@ -136,7 +136,7 @@ TLS for incoming and outgoing connections can be configured in the same way as f

```xml
<openAPIProxy port="2000">
<spec dir="openapi"/>
<openapi dir="openapi"/>
<ssl>
<keystore location="..."/>
<truststore location="..."/>
Expand All @@ -156,11 +156,11 @@ TLS for incoming and outgoing connections can be configured in the same way as f
The behaviour of the _openAPIProxy_ can be modified like other proxies with plugins and interceptors. See the [examples](..) and the [configuration reference](http://membrane-soa.org/service-proxy-doc/4.8/configuration/reference/).

```xml
<openAPIProxy port="2000">
<spec dir="openapi"/>
<api port="2000">
<openapi dir="openapi"/>
<tokenValidator endpoint="https://login.predic8.de/oauth2/userinfo"/>
<log/>
</openAPIProxy>
</api>
```

## Ids of OpenAPI Documents
Expand Down
11 changes: 11 additions & 0 deletions distribution/examples/openapi/openapi-proxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,17 @@ The validator checks the request against the OpenAPI definition. Cause the value

7. Try also a value for _name_ that is longer than 10 characters.

8. Have a look at the configuration in the `proxies.xml`file:

```xml
<api port="2000">
<openapi location="fruitshop-api.yml"
validateRequests="yes"
validateResponses="yes"
validationDetails="yes"/>
</api>
```

For more about the OpenAPI Validation features of Membrane have a look at:

- [Simple Validation Example](../openapi-validation-simple)
Expand Down

0 comments on commit 2476b7f

Please sign in to comment.