Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
= To Do | ||
:source-highlighter: highlightjs | ||
|
||
== New Features | ||
|
||
=== JSON driven json generation | ||
|
||
En el método ToJSONObject, en lugar de una lista de nombres en un atributo, pasar una "plantilla" basada en json. La plantillas seria simplmente una instancia ejemplo, pero omitiendo los valores de las claves | ||
|
||
[source, json] | ||
---- | ||
{ "Fecha":, | ||
"Hora":, | ||
"Paciente": { | ||
"Apellidos":, "Nombre":, "NumPac":, "TextoTrato": | ||
}, | ||
"Texto": | ||
} | ||
---- | ||
|
||
|
||
[source, delphi] | ||
---- | ||
TJSON.ToJsonObject(Entity, '"Fecha":,"Hora":,"Paciente": {"Apellidos":, "Nombre":, "NumPac":, "TextoTrato":}, "Texto":') | ||
---- | ||
|
||
O tal vez en un JSONAttr para la clase. Algo asi: | ||
|
||
[source, delphi] | ||
---- | ||
Attr := JSONTemplateAttribute.Create(True, '"Fecha":,"Hora":,"Paciente": {"Apellidos":, "Nombre":, "NumPac":, "TextoTrato":}, "Texto":'); | ||
TJSON.ToJsonObject(Entity, Attr); | ||
---- | ||
|
||
Tambien podemos considerar admitir que la plantilla se escriba en un "json aligerado", pero facil de convertir en json valido con algo de RegExp, de forma que nos evitemos hacer un parser especifico. | ||
|
||
[source, delphi] | ||
---- | ||
TJSON.ToJsonObject(Entity, 'Fecha, Hora, Paciente: {Apellidos, Nombre, NumPac, TextoTrato}, Texto'); | ||
---- | ||
|
||
== Enhancements / Refactorings | ||
|
||
== Bug fixing |