Skip to content

Improve message for error "incompatible properties" #315

@mikeharder

Description

@mikeharder

The message for error "incompatible properties" only includes the key:

if (!this.isEqual(allOfSchema.properties[key], schemaList[key])) {
throw new Error(`incompatible properties : ${key} `)
}

This can make it hard to determine the problem in the spec, especially if the incompatible property is being pulled in through allOf. For example:

Azure/azure-sdk-tools#7917

This error could be improved by:

  1. Include the incompatible properties themselves in the error message
  2. Include line numbers of the incompatible properties

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

🎊 Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions