feat: implemented new linting of entities to support new scorecards#2495
feat: implemented new linting of entities to support new scorecards#2495AlbinaBlazhko17 merged 28 commits intomainfrom
Conversation
🦋 Changeset detectedLatest commit: 1a28502 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
bb3606d to
475e9f8
Compare
|
|
||
| // Store mapping from discriminator value to actual type name | ||
| if (typeof actualTypeName === 'string') { | ||
| discriminatorMapping[discriminatorValue] = actualTypeName; |
There was a problem hiding this comment.
Not sure why do we need to mutate it here. Don't we receive the discriminator mapping in the needed form already?
There was a problem hiding this comment.
I've added here this logic to return proper nodeName, so i can use the discriminator function without any additional logic. Without it i will pass e.g. 'domain' and this function will return 'domain' instead of 'DomainEntity'. I can remove this logic from the discriminator function, but in this case for me this function does not make sense. WDYT?
4257ecb to
0c4911a
Compare
… and transfer tests
…ment and refactor hasComponent function
260b5e9 to
1a28502
Compare
What/Why/How?
lintEntityWithScorecardLevel, which will be used inportalto lint new entities with new scorecard functionality.lintSchemafor linting specific schema. If entity hasdata-schematype we need to lint only provided schema.Assertions(custom rules) inlintEntityFile.@redocly/config.json-schema-adapter.tsto handlenodeTypeNameif provided. Added returning ofdiscriminatorFuncfrom adapter to get proper rootType. Added functionality todiscriminatorFuncfor handling mapping the default naming and providednodeTypeName.Opened questions:
api-operations.lt,lte,gte, etc.) for arrays.Reference
Testing
Ran tests in
CLIandRealm.Screenshots (optional)
Check yourself
Security