Skip to content

Commit

Permalink
reproduce issue #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 20, 2023
1 parent e8667b6 commit 9b0994c
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/132f29769dfecfc808adc58f756be43171054094/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 9b0994c

Please sign in to comment.