mirror of
https://github.com/Redocly/redoc.git
synced 2025-03-03 17:35:46 +03:00
fix: fix deref logic for oas3.1 (#1767)
This commit is contained in:
parent
3b8d6441bd
commit
4fb9c83525
|
@ -195,7 +195,7 @@ export class OpenAPIParser {
|
|||
}
|
||||
if (mergeAsAllOf && keys.some((k) => k !== 'description' && k !== 'title' && k !== 'externalDocs')) {
|
||||
return {
|
||||
allOf: [resolved, rest],
|
||||
allOf: [rest, resolved],
|
||||
};
|
||||
} else {
|
||||
// small optimization
|
||||
|
|
|
@ -80,7 +80,7 @@ export class SchemaModel {
|
|||
makeObservable(this);
|
||||
|
||||
this.pointer = schemaOrRef.$ref || pointer || '';
|
||||
this.rawSchema = parser.shallowDeref(schemaOrRef);
|
||||
this.rawSchema = parser.deref(schemaOrRef, false, true);
|
||||
this.schema = parser.mergeAllOf(this.rawSchema, this.pointer, isChild);
|
||||
|
||||
this.init(parser, isChild);
|
||||
|
@ -363,7 +363,7 @@ function buildFields(
|
|||
): FieldModel[] {
|
||||
const props = schema.properties || {};
|
||||
const additionalProps = schema.additionalProperties;
|
||||
const defaults = schema.default || {};
|
||||
const defaults = schema.default;
|
||||
let fields = Object.keys(props || []).map((fieldName) => {
|
||||
let field = props[fieldName];
|
||||
|
||||
|
@ -384,7 +384,7 @@ function buildFields(
|
|||
required,
|
||||
schema: {
|
||||
...field,
|
||||
default: field.default === undefined ? defaults[fieldName] : field.default,
|
||||
default: field.default === undefined && defaults ? defaults[fieldName] : field.default,
|
||||
},
|
||||
},
|
||||
$ref + '/properties/' + fieldName,
|
||||
|
|
Loading…
Reference in New Issue
Block a user