-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update parser_and_mv to remove A1 reading and use schemas.yaml #222
Changes from all commits
f6672d3
5b8fd32
8ce7ee3
d00e2af
935c39a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,18 +9,18 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; | |
|
||
{{ range (datasource "config").schemas }} | ||
{{- if eq .automaticGeneration "Y" -}} | ||
import com.hubsante.model.{{ .package }}.{{ .rootElement | title }}; | ||
import com.hubsante.model.{{ .package }}.{{ .rootElement | title }}Wrapper; | ||
{{ end }}{{ end -}} | ||
import com.hubsante.model.{{ .package }}.{{ .rootElement | title }};{{ if ne .rootElement "distributionElement" }} | ||
import com.hubsante.model.{{ .package }}.{{ .rootElement | title }}Wrapper;{{ end }}{{ end }} | ||
{{ end -}} | ||
Comment on lines
+12
to
+14
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK. Je me demande si à l'avenir on ne pourrait pas avoir d'autres messages qui n'étendraient pas DistributionElement. On se pose quand même la question de ne pas porter systématiquement les champs du DistributionElement, qui est assez lourd et redondant avec des infos déjà présentes au niveau de l'enveloppe, pour les messages qui n'ont pas vocation à être interforces. Si on va dans cette direction, on aura peut-être intérêt à terme à remplacer la mécanique "ne rootElement" par un attribut custom qu'on pourrait avoir également dans le tableur Excel. Mais ça me paraît OK pour le moment ! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
import com.hubsante.model.report.ErrorWrapper; | ||
import com.hubsante.model.custom.CustomMessage; | ||
import java.util.Map; | ||
import java.util.stream.Collectors; | ||
import java.util.stream.Stream; | ||
|
||
@JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION) | ||
@JsonSubTypes({ {{ range $i, $e := (datasource "config").schemas }}{{if eq .automaticGeneration "Y"}} | ||
@JsonSubTypes.Type({{ .rootElement | title }}Wrapper.class),{{end}}{{end}} | ||
@JsonSubTypes({ {{ range $i, $e := (datasource "config").schemas }}{{if eq .automaticGeneration "Y"}}{{ if ne .rootElement "distributionElement" }} | ||
@JsonSubTypes.Type({{ .rootElement | title }}Wrapper.class),{{ end }}{{end}}{{end}} | ||
@JsonSubTypes.Type(ErrorWrapper.class), | ||
@JsonSubTypes.Type(CustomMessage.class) | ||
}) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -116,8 +116,8 @@ def get_nomenclature(elem): | |
def is_custom_content(): | ||
return MODEL_TYPE == "customContent" | ||
|
||
def is_allowing_additional_properties(): | ||
return is_custom_content() or MODEL_TYPE == "DistributionElement" | ||
def is_allowing_additional_properties(name): | ||
return is_custom_content() or MODEL_TYPE == "DistributionElement" or name == "RC-DE" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. par curiosité, pourquoi ajouter la condition sur le name ="RC-DE" ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
Path('out/' + name).mkdir(parents=True, exist_ok=True) | ||
Comment on lines
118
to
122
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. on utilise les deux, ou c'est qu'on a abandonné l'utilisation deMODEL_TYPE pour ne plus utiliser que "name" ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. J'avais vu avec Saveliy qu'il fallait accepter les données supplémentaires spécialement pour le RC-DE, c'est pourquoi j'ai ajouté une condition sur le name. Quand au MODEL_TYPE je n'y ai pas spécialement touché. |
||
|
||
|
@@ -481,7 +481,7 @@ def build_example(elem): | |
'required': [], | ||
'properties': {}, | ||
'definitions': {}, | ||
'additionalProperties': is_allowing_additional_properties() | ||
'additionalProperties': is_allowing_additional_properties(name) | ||
} | ||
|
||
def has_format_details(elem, details): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je passe peut-être à côté de l'enjeu : pourquoi a-t-on remonté ce bloc ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Car le schema.yaml est généré dans la fonction output_schemas_yaml, et il doit avoir été généré avant pour être utilisé dans la fonction parser_and_mv du workflow.py