File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ func (b *Builder) collectSchemas() {
132132 c .collectSchemasInResponse (op )
133133 c .collectSchemasInParams (op )
134134 c .collectSchemasInRequest (op )
135-
135+
136136 for _ , schema := range c {
137137 if schema .GetReference () == schemaRef {
138138 foundSchema = schema
@@ -147,7 +147,7 @@ func (b *Builder) collectSchemas() {
147147 break
148148 }
149149 }
150-
150+
151151 if foundSchema != nil && ! slices .ContainsFunc (schemasByTag ["_shared" ], func (sp * base.SchemaProxy ) bool {
152152 return sp .GetReference () == schemaRef
153153 }) {
@@ -159,6 +159,13 @@ func (b *Builder) collectSchemas() {
159159 }
160160 }
161161
162+ // Sort shared schemas to ensure deterministic order
163+ if sharedSchemas , ok := schemasByTag ["_shared" ]; ok {
164+ slices .SortFunc (sharedSchemas , func (a , b * base.SchemaProxy ) int {
165+ return strings .Compare (a .GetReference (), b .GetReference ())
166+ })
167+ }
168+
162169 b .schemasByTag = schemasByTag
163170}
164171
You can’t perform that action at this time.
0 commit comments