Aktueller Stand

This commit is contained in:
2026-01-22 19:05:45 +01:00
parent 85dee61a4d
commit e280e4eadb
1967 changed files with 397327 additions and 74093 deletions

View File

@@ -45,7 +45,7 @@ test('should throw id source schema has a key with a same key as ref schema, but
} catch (err) {
assert.strictEqual(
err.message,
'Cannot resolve ref "schemaId2". Property "properties" is already exist in schema "schemaId1".'
'Cannot resolve ref "schemaId2". Property "properties" already exists in schema "schemaId1".'
)
}
})
@@ -234,3 +234,54 @@ test('should throw if target ref schema is not found', () => {
)
}
})
test('should deref schema without root $id', () => {
const refResolver = new RefResolver()
const schemaId = 'schemaId1'
const schema = {
type: 'object',
definitions: {
id1: {
type: 'object',
properties: {
id1: {
type: 'integer'
}
}
}
},
allOf: [
{
$ref: '#/definitions/id1'
}
]
}
refResolver.addSchema(schema, schemaId)
const derefSchema = refResolver.getDerefSchema(schemaId)
assert.deepStrictEqual(derefSchema, {
type: 'object',
definitions: {
id1: {
type: 'object',
properties: {
id1: {
type: 'integer'
}
}
}
},
allOf: [
{
type: 'object',
properties: {
id1: {
type: 'integer'
}
}
}
]
})
})