You are not logged in.
Pages: 1
Hi.
I have interface based service:
function TestBcd(const Val: Tbcd): TServiceCustomAnswer;
it is shown in swagger like this:
{
"Val": {
"Precision": 0,
"SignSpecialPlaces": 0,
"Fraction": [
"string"
]
}
}
but I want swagger shows:
{
"Val": "string"
}
service method works when I pass parameter as string : "123456789.123456".
when I try to define this data type in template mustache file I got an error: (Parser error on line 623 duplicated mapping key)
"TBcd": {
"type": "string",
"description": "A string value that can be TBCD example : \"123456.123\""
}
Last edited by anouri (2025-12-06 09:01:02)
Offline
IIRC you could just include mormot.db.rad.pas unit in your project.
Then it would register TBcd and serialize it as JSON "string" to keep the precision.
With a two seconds search of "TBcd JSON" in the forum, you would have found
https://synopse.info/forum/viewtopic.php?id=7100
Offline
Hi AB.
I don't have problem with TBCD itself. Framework works correctly. My problem is in swagger.
I try my best not to waste your valuable time as much as possible. But in cases where I cannot solve the problem in any other way, I am forced to raise it here.
Last edited by anouri (2025-12-08 13:32:59)
Offline
Ok now I understand.
Please try with
https://github.com/synopse/mORMot2/commit/828a19555
Offline
Pages: 1