Skip to content

Commit

Permalink
reproduce issue getkin#423
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre Fenoll <pierrefenoll@gmail.com>
  • Loading branch information
fenollp committed Oct 2, 2021
1 parent 9b46ae7 commit edded15
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions openapi3/loader_outside_refs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,34 @@ func TestLoadOutsideRefs(t *testing.T) {

require.Equal(t, "string", doc.Paths["/service"].Get.Responses["200"].Value.Content["application/json"].Schema.Value.Items.Value.AllOf[0].Value.Properties["created_at"].Value.Type)
}

func TestIssue423(t *testing.T) {
spec := `
info:
description: test
title: test
version: 0.0.0
openapi: 3.0.1
paths:
/api/bundles:
get:
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Data'
components:
schemas:
Data:
description: rbac Data
properties:
roles:
$ref: "https://raw.githubusercontent.com/kubernetes/kubernetes/master/api/openapi-spec/swagger.json#/definitions/io.k8s.api.rbac.v1.RoleList"
`

loader := NewLoader()
loader.IsExternalRefsAllowed = true
loader.LoadFromData([]byte(spec))
}

0 comments on commit edded15

Please sign in to comment.