fix(openapi): document graphql cache headers
Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
parent
50b6a9197f
commit
02082db8f4
2 changed files with 7 additions and 1 deletions
|
|
@ -681,7 +681,7 @@ func graphqlRequestSchema() map[string]any {
|
|||
}
|
||||
|
||||
func graphqlResponses() map[string]any {
|
||||
successHeaders := mergeHeaders(standardResponseHeaders(), rateLimitSuccessHeaders())
|
||||
successHeaders := mergeHeaders(standardResponseHeaders(), rateLimitSuccessHeaders(), cacheSuccessHeaders())
|
||||
errorHeaders := mergeHeaders(standardResponseHeaders(), rateLimitSuccessHeaders())
|
||||
|
||||
return map[string]any{
|
||||
|
|
|
|||
|
|
@ -247,6 +247,12 @@ func TestSpecBuilder_Good_GraphQLEndpoint(t *testing.T) {
|
|||
t.Fatalf("expected GraphQL operationId to be post_graphql, got %v", postOp["operationId"])
|
||||
}
|
||||
|
||||
responses := postOp["responses"].(map[string]any)
|
||||
successHeaders := responses["200"].(map[string]any)["headers"].(map[string]any)
|
||||
if _, ok := successHeaders["X-Cache"]; !ok {
|
||||
t.Fatal("expected X-Cache header on GraphQL 200 response")
|
||||
}
|
||||
|
||||
requestBody := postOp["requestBody"].(map[string]any)
|
||||
schema := requestBody["content"].(map[string]any)["application/json"].(map[string]any)["schema"].(map[string]any)
|
||||
properties := schema["properties"].(map[string]any)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue