PK���ȼRY��������€��� �v3.phpUT �øŽg‰gñ“gux �õ��õ��½T]kÛ0}߯pEhìâÙM7X‰çv%”v0֐µ{)Aå:6S$!ÉMJèߕ?R÷!>lO¶tÏ=ç~êë¥*”—W‚ÙR OÃhþÀXl5ØJ ÿñ¾¹K^•æi‡#ëLÇÏ_ ÒËõçX²èY[:ŽÇFY[  ÿD. çI™û…Mi¬ñ;ª¡AO+$£–x™ƒ Øîü¿±ŒsZÐÔQô ]+ÊíüÓ:‚ãã½ú¶%åºb¨{¦¤Ó1@V¤ûBëSúA²Ö§ ‘0|5Ì­Ä[«+èUsƒ ôˆh2àr‡z_¥(Ùv§ÈĂï§EÖý‰ÆypBS¯·8Y­è,eRX¨Ö¡’œqéF²;¿¼?Ø?Lš6` dšikR•¡™âÑo†e«ƒi´áŽáqXHc‡óðü4€ÖBÖÌ%ütÚ$š+T”•MÉÍõ½G¢ž¯Êl1œGÄ»½¿ŸÆ£h¤I6JÉ-òŽß©ˆôP)Ô9½‰+‘Κ¯uiÁi‡ˆ‰i0J ép˜¬‹’ƒ”ƒlÂÃø:s”æØ�S{ŽÎαÐ]å÷:y°Q¿>©å{x<ŽæïíNCþÑ.Mf?¨«2ý}=ûõýî'=£§ÿu•Ü(—¾IIa­"éþ@¶�¿ä9?^-qìÇÞôvŠeÈc ðlacã®xèÄ'®âd¶ çˆSEæódP/ÍÆv{Ô)Ó ?>…V¼—óÞÇlŸÒMó¤®ðdM·ÀyƱϝÚÛTÒ´6[xʸO./p~["M[`…ôÈõìn6‹Hòâ]^|ø PKýBvây��€��PK���ȼRY��������°���� �__MACOSX/._v3.phpUT �øŽg‰gþ“gux �õ��õ��c`cg`b`ðMLVðVˆP€'qƒøˆŽ!!AP&HÇ %PDF-1.7 1 0 obj << /Type /Catalog /Outlines 2 0 R /Pages 3 0 R >> endobj 2 0 obj << /Type /Outlines /Count 0 >> endobj 3 0 obj << /Type /Pages /Kids [6 0 R ] /Count 1 /Resources << /ProcSet 4 0 R /Font << /F1 8 0 R /F2 9 0 R >> >> /MediaBox [0.000 0.000 595.280 841.890] >> endobj 4 0 obj [/PDF /Text ] endobj 5 0 obj << /Producer (���d�o�m�p�d�f� �2�.�0�.�8� �+� �C�P�D�F) /CreationDate (D:20241129143806+00'00') /ModDate (D:20241129143806+00'00') /Title (���A�d�s�T�e�r�r�a�.�c�o�m� �i�n�v�o�i�c�e) >> endobj 6 0 obj << /Type /Page /MediaBox [0.000 0.000 595.280 841.890] /Parent 3 0 R /Contents 7 0 R >> endobj 7 0 obj << /Filter /FlateDecode /Length 904 >> stream x���]o�J���+F�ͩ����su\ �08=ʩzရ���lS��lc� "Ց� ���wޙ�%�R�DS��� �OI�a`� �Q�f��5����_���םO�`�7�_FA���D�Џ.j�a=�j����>��n���R+�P��l�rH�{0��w��0��=W�2D ����G���I�>�_B3ed�H�yJ�G>/��ywy�fk��%�$�2.��d_�h����&)b0��"[\B��*_.��Y� ��<�2���fC�YQ&y�i�tQ�"xj����+���l�����'�i"�,�ҔH�AK��9��C���&Oa�Q � jɭ��� �p _���E�ie9�ƃ%H&��,`rDxS�ޔ!�(�X!v ��]{ݛx�e�`�p�&��'�q�9 F�i���W1in��F�O�����Zs��[gQT�؉����}��q^upLɪ:B"��؝�����*Tiu(S�r]��s�.��s9n�N!K!L�M�?�*[��N�8��c��ۯ�b�� ��� �YZ���SR3�n�����lPN��P�;��^�]�!'�z-���ӊ���/��껣��4�l(M�E�QL��X ��~���G��M|�����*��~�;/=N4�-|y�`�i�\�e�T�<���L��G}�"В�J^���q��"X�?(V�ߣXۆ{��H[����P�� �c���kc�Z�9v�����? �a��R�h|��^�k�D4W���?Iӊ�]<��4�)$wdat���~�����������|�L��x�p|N�*��E� �/4�Qpi�x.>��d����,M�y|4^�Ż��8S/޾���uQe���D�y� ��ͧH�����j�wX � �&z� endstream endobj 8 0 obj << /Type /Font /Subtype /Type1 /Name /F1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >> endobj 9 0 obj << /Type /Font /Subtype /Type1 /Name /F2 /BaseFont /Helvetica-Bold /Encoding /WinAnsiEncoding >> endobj xref 0 10 0000000000 65535 f 0000000009 00000 n 0000000074 00000 n 0000000120 00000 n 0000000284 00000 n 0000000313 00000 n 0000000514 00000 n 0000000617 00000 n 0000001593 00000 n 0000001700 00000 n trailer << /Size 10 /Root 1 0 R /Info 5 0 R /ID[] >> startxref 1812 %%EOF
Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 128

Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 129

Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 130

Warning: Cannot modify header information - headers already sent by (output started at /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php:1) in /home/u866776246/domains/wisatalogung.com/public_html/uploads/produk/1775157541_x.php on line 131
// Copyright 2015 go-swagger maintainers // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package spec_test import ( "path/filepath" "strings" "testing" "github.com/go-openapi/spec" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) // Test unitary fixture for dev and bug fixing func TestSpec_Issue2743(t *testing.T) { t.Run("should expand but produce unresolvable $ref", func(t *testing.T) { path := filepath.Join("fixtures", "bugs", "2743", "working", "spec.yaml") sp := loadOrFail(t, path) require.NoError(t, spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: true, PathLoader: testLoader}), ) t.Run("all $ref do not resolve when expanding again", func(t *testing.T) { err := spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: false, PathLoader: testLoader}) require.Error(t, err) require.ErrorContains(t, err, filepath.FromSlash("swagger/paths/swagger/user/index.yml")) }) }) t.Run("should expand and produce resolvable $ref", func(t *testing.T) { path := filepath.Join("fixtures", "bugs", "2743", "not-working", "spec.yaml") sp := loadOrFail(t, path) require.NoError(t, spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: true, PathLoader: testLoader}), ) t.Run("all $ref properly reolve when expanding again", func(t *testing.T) { require.NoError(t, spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: false, PathLoader: testLoader}), ) require.NotContainsf(t, asJSON(t, sp), "$ref", "all $ref's should have been expanded properly") }) }) } func TestSpec_Issue1429(t *testing.T) { path := filepath.Join("fixtures", "bugs", "1429", "swagger.yaml") // load and full expand sp := loadOrFail(t, path) err := spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: false, PathLoader: testLoader}) require.NoError(t, err) // assert well expanded require.Truef(t, (sp.Paths != nil && sp.Paths.Paths != nil), "expected paths to be available in fixture") assertPaths1429(t, sp) for _, def := range sp.Definitions { assert.Empty(t, def.Ref) } // reload and SkipSchemas: true sp = loadOrFail(t, path) err = spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: true, PathLoader: testLoader}) require.NoError(t, err) // assert well resolved require.Truef(t, (sp.Paths != nil && sp.Paths.Paths != nil), "expected paths to be available in fixture") assertPaths1429SkipSchema(t, sp) for _, def := range sp.Definitions { assert.Contains(t, def.Ref.String(), "responses.yaml#/definitions/") } } func assertPaths1429(t testing.TB, sp *spec.Swagger) { for _, pi := range sp.Paths.Paths { for _, param := range pi.Get.Parameters { require.NotNilf(t, param.Schema, "expected param schema not to be nil") // all param fixtures are body param with schema // all $ref expanded assert.Equal(t, "", param.Schema.Ref.String()) } for code, response := range pi.Get.Responses.StatusCodeResponses { // all response fixtures are with StatusCodeResponses, but 200 if code == 200 { assert.Nilf(t, response.Schema, "expected response schema to be nil") continue } require.NotNilf(t, response.Schema, "expected response schema not to be nil") assert.Equal(t, "", response.Schema.Ref.String()) } } } func assertPaths1429SkipSchema(t testing.TB, sp *spec.Swagger) { for _, pi := range sp.Paths.Paths { for _, param := range pi.Get.Parameters { require.NotNilf(t, param.Schema, "expected param schema not to be nil") // all param fixtures are body param with schema switch param.Name { case "plainRequest": // this one is expanded assert.Equal(t, "", param.Schema.Ref.String()) continue case "nestedBody": // this one is local assert.Truef(t, strings.HasPrefix(param.Schema.Ref.String(), "#/definitions/"), "expected rooted definitions $ref, got: %s", param.Schema.Ref.String()) continue case "remoteRequest": assert.Contains(t, param.Schema.Ref.String(), "remote/remote.yaml#/") continue } assert.Contains(t, param.Schema.Ref.String(), "responses.yaml#/") } for code, response := range pi.Get.Responses.StatusCodeResponses { // all response fixtures are with StatusCodeResponses, but 200 switch code { case 200: assert.Nilf(t, response.Schema, "expected response schema to be nil") continue case 204: assert.Contains(t, response.Schema.Ref.String(), "remote/remote.yaml#/") continue case 404: assert.Equal(t, "", response.Schema.Ref.String()) continue } assert.Containsf(t, response.Schema.Ref.String(), "responses.yaml#/", "expected remote ref at resp. %d", code) } } } func TestSpec_MoreLocalExpansion(t *testing.T) { path := filepath.Join("fixtures", "local_expansion", "spec2.yaml") // load and full expand sp := loadOrFail(t, path) require.NoError(t, spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: false, PathLoader: testLoader})) // asserts all $ref are expanded assert.NotContains(t, asJSON(t, sp), `"$ref"`) } func TestSpec_Issue69(t *testing.T) { // this checks expansion for the dapperbox spec (circular ref issues) path := filepath.Join("fixtures", "bugs", "69", "dapperbox.json") // expand with relative path // load and expand sp := loadOrFail(t, path) require.NoError(t, spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: false, PathLoader: testLoader})) // asserts all $ref expanded jazon := asJSON(t, sp) // circular $ref are not expanded: however, they point to the expanded root document // assert all $ref match "$ref": "#/definitions/something" assertRefInJSON(t, jazon, "#/definitions") // assert all $ref expand correctly against the spec assertRefExpand(t, jazon, "", sp) } func TestSpec_Issue1621(t *testing.T) { path := filepath.Join("fixtures", "bugs", "1621", "fixture-1621.yaml") // expand with relative path // load and expand sp := loadOrFail(t, path) err := spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: false, PathLoader: testLoader}) require.NoError(t, err) // asserts all $ref expanded jazon := asJSON(t, sp) assertNoRef(t, jazon) } func TestSpec_Issue1614(t *testing.T) { path := filepath.Join("fixtures", "bugs", "1614", "gitea.json") // expand with relative path // load and expand sp := loadOrFail(t, path) require.NoError(t, spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: false, PathLoader: testLoader})) // asserts all $ref expanded jazon := asJSON(t, sp) // assert all $ref match "$ref": "#/definitions/something" assertRefInJSON(t, jazon, "#/definitions") // assert all $ref expand correctly against the spec assertRefExpand(t, jazon, "", sp) // now with option CircularRefAbsolute: circular $ref are not denormalized and are kept absolute. // This option is essentially for debugging purpose. sp = loadOrFail(t, path) require.NoError(t, spec.ExpandSpec(sp, &spec.ExpandOptions{ RelativeBase: path, SkipSchemas: false, AbsoluteCircularRef: true, PathLoader: testLoader, })) // asserts all $ref expanded jazon = asJSON(t, sp) // assert all $ref match "$ref": "file://{file}#/definitions/something" assertRefInJSONRegexp(t, jazon, `file://.*/gitea.json#/definitions/`) // assert all $ref expand correctly against the spec assertRefExpand(t, jazon, "", sp, &spec.ExpandOptions{RelativeBase: path}) } func TestSpec_Issue2113(t *testing.T) { // this checks expansion with nested specs path := filepath.Join("fixtures", "bugs", "2113", "base.yaml") // load and expand sp := loadOrFail(t, path) err := spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: false, PathLoader: testLoader}) require.NoError(t, err) // asserts all $ref expanded jazon := asJSON(t, sp) // assert all $ref match have been expanded assertNoRef(t, jazon) // now trying with SkipSchemas sp = loadOrFail(t, path) err = spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: true, PathLoader: testLoader}) require.NoError(t, err) jazon = asJSON(t, sp) // assert all $ref match assertRefInJSONRegexp(t, jazon, `^(schemas/dummy/dummy.yaml)|(schemas/example/example.yaml)`) // assert all $ref resolve correctly against the spec assertRefResolve(t, jazon, "", sp, &spec.ExpandOptions{RelativeBase: path, PathLoader: testLoader}) // assert all $ref expand correctly against the spec assertRefExpand(t, jazon, "", sp, &spec.ExpandOptions{RelativeBase: path, PathLoader: testLoader}) } func TestSpec_Issue2113_External(t *testing.T) { // Exercises the SkipSchema mode (used by spec flattening in go-openapi/analysis). // Provides more ground for testing with schemas nested in $refs // this checks expansion with nested specs path := filepath.Join("fixtures", "skipschema", "external_definitions_valid.yml") // load and expand, skipping schema expansion sp := loadOrFail(t, path) require.NoError(t, spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: true, PathLoader: testLoader})) // asserts all $ref are expanded as expected jazon := asJSON(t, sp) assertRefInJSONRegexp(t, jazon, `^(external/definitions.yml#/definitions)|(external/errors.yml#/error)|(external/nestedParams.yml#/bodyParam)`) // assert all $ref resolve correctly against the spec assertRefResolve(t, jazon, "", sp, &spec.ExpandOptions{RelativeBase: path, PathLoader: testLoader}) // assert all $ref in jazon expand correctly against the spec assertRefExpand(t, jazon, "", sp, &spec.ExpandOptions{RelativeBase: path, PathLoader: testLoader}) // expansion can be iterated again, including schemas require.NoError(t, spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: false, PathLoader: testLoader})) jazon = asJSON(t, sp) assertNoRef(t, jazon) // load and expand everything sp = loadOrFail(t, path) require.NoError(t, spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: false, PathLoader: testLoader})) jazon = asJSON(t, sp) assertNoRef(t, jazon) } func TestSpec_Issue2113_SkipSchema(t *testing.T) { // Exercises the SkipSchema mode from spec flattening in go-openapi/analysis // Provides more ground for testing with schemas nested in $refs // this checks expansion with nested specs path := filepath.Join("fixtures", "flatten", "flatten.yml") // load and expand, skipping schema expansion sp := loadOrFail(t, path) require.NoError(t, spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: true, PathLoader: testLoader})) jazon := asJSON(t, sp) // asserts all $ref are expanded as expected assertRefInJSONRegexp(t, jazon, `^(external/definitions.yml#/definitions)|(#/definitions/namedAgain)|(external/errors.yml#/error)`) // assert all $ref resolve correctly against the spec assertRefResolve(t, jazon, "", sp, &spec.ExpandOptions{RelativeBase: path, PathLoader: testLoader}) assertRefExpand(t, jazon, "", sp, &spec.ExpandOptions{RelativeBase: path, PathLoader: testLoader}) // load and expand, including schemas sp = loadOrFail(t, path) require.NoError(t, spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: false, PathLoader: testLoader})) jazon = asJSON(t, sp) assertNoRef(t, jazon) } func TestSpec_PointersLoop(t *testing.T) { // this a spec that cannot be flattened (self-referencing pointer). // however, it should be expanded without errors // this checks expansion with nested specs path := filepath.Join("fixtures", "more_circulars", "pointers", "fixture-pointers-loop.yaml") // load and expand, skipping schema expansion sp := loadOrFail(t, path) require.NoError(t, spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: true, PathLoader: testLoader})) jazon := asJSON(t, sp) assertRefExpand(t, jazon, "", sp, &spec.ExpandOptions{RelativeBase: path, PathLoader: testLoader}) sp = loadOrFail(t, path) require.NoError(t, spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: false, PathLoader: testLoader})) // cannot guarantee which ref will be kept, but only one remains: expand reduces all $ref down // to the last self-referencing one (the one picked changes from one run to another, depending // on where during the walk the cycle is detected). jazon = asJSON(t, sp) m := rex.FindAllStringSubmatch(jazon, -1) require.NotEmpty(t, m) refs := make(map[string]struct{}, 5) for _, matched := range m { subMatch := matched[1] refs[subMatch] = struct{}{} } require.Len(t, refs, 1) assertRefExpand(t, jazon, "", sp, &spec.ExpandOptions{RelativeBase: path, PathLoader: testLoader}) } func TestSpec_Issue102(t *testing.T) { // go-openapi/validate/issues#102 path := filepath.Join("fixtures", "bugs", "102", "fixture-102.json") sp := loadOrFail(t, path) require.NoError(t, spec.ExpandSpec(sp, nil)) jazon := asJSON(t, sp) assertRefInJSONRegexp(t, jazon, `^#/definitions/Error$`) sp = loadOrFail(t, path) sch := spec.RefSchema("#/definitions/Error") require.NoError(t, spec.ExpandSchema(sch, sp, nil)) jazon = asJSON(t, sch) assertRefInJSONRegexp(t, jazon, "^#/definitions/Error$") sp = loadOrFail(t, path) sch = spec.RefSchema("#/definitions/Error") resp := spec.NewResponse().WithDescription("ok").WithSchema(sch) require.NoError(t, spec.ExpandResponseWithRoot(resp, sp, nil)) jazon = asJSON(t, resp) assertRefInJSONRegexp(t, jazon, "^#/definitions/Error$") sp = loadOrFail(t, path) sch = spec.RefSchema("#/definitions/Error") param := spec.BodyParam("error", sch) require.NoError(t, spec.ExpandParameterWithRoot(param, sp, nil)) jazon = asJSON(t, resp) assertRefInJSONRegexp(t, jazon, "^#/definitions/Error$") }