Repository navigation
feat(schema-resolver/analyzer): deepen simplifySchema and add map flatten warn - #23
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changements apportés
schema-resolver.tssimplifySchemaen 6 phases séquentielles explicites : dépliage des combinateurs mono-branche, déduplicationoneOf/anyOf, récursion dans les branchesallOfmulti-branches, récursion dansproperties, récursion dansitems(schéma unique et tuple), récursion dansadditionalPropertiesresultpour chaîner les transformations sans muter le schéma originalanalyzer.tsMAP_IMPLICIT_FLATTEN(sévéritéwarning) lorsque le helpermapaplatit implicitement le tableau d'entrée d'un niveau avant de mappersrc/helpers/map-helpers.ts!Array.isArray(item)dansmapPropertypour ne pas traiter les tableaux comme des objets après leflat(1)flat(1)src/types.tsMAP_IMPLICIT_FLATTENà l'unionDiagnosticCodeTests
map-helpers.spec.ts: les vérificationsdiagnostics.toHaveLength(0)sont remplacées par un filtre sur les erreurs uniquement, pour tolérer les nouveaux warningsMAP_IMPLICIT_FLATTENmap helper — flat(1) behaviorcouvrant : tableau plat, aplatissement 1 niveau, absence d'aplatissement au-delà de 1 niveau, items non-objets, items tableauxmap helper — MAP_IMPLICIT_FLATTEN diagnosticcouvrant l'émission et la non-émission du warning selon le schémaschema-resolver.spec.ts: récursion dansproperties,allOf,items(single et tuple),additionalProperties, profondeur arbitraire, idempotence, absence de changement quand rien n'est simplifiable🚀