Skip to content
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

Problema com TJSONBool no XE7 #18

Open
chacalfloripa opened this issue May 12, 2020 · 1 comment
Open

Problema com TJSONBool no XE7 #18

chacalfloripa opened this issue May 12, 2020 · 1 comment

Comments

@chacalfloripa
Copy link

Olá Jaloto, ao tentar usar o SwagDoc no XE7 a classe TJSONBool não foi localizado pois só foi implementada no Delphi Seattle. A baixo vou listar os locais e as modificação que fiz.

Swag.Doc.Path.Operation.pas

Linha 259
if fDeprecated then
{$IF Defined(SeattleOrBetter)}
vJsonObject.AddPair(c_SwagPathOperationDeprecated, TJSONBool.Create(fDeprecated));
{$ELSE}
vJsonObject.AddPair(c_SwagPathOperationDeprecated, TJSONString.Create(BoolToStr(fDeprecated)));
{$ENDIF}

Swag.Doc.Path.Operation.RequestParameter.pas

Linha 197
if fRequired or (fInLocation = rpiPath) then
vJsonObject.AddPair(c_SwagRequestParameterRequired, TJSONTrue.Create);

if fAllowEmptyValue and (fInLocation = rpiQuery) or (fInLocation = rpiFormData) then
vJsonObject.AddPair(c_SwagRequestParameterAllowEmptyValue, TJSONTrue.Create);

Linha 243
if Assigned(pJson.Values[c_SwagRequestParameterAllowEmptyValue]) and
((fInLocation = rpiQuery) or (fInLocation = rpiFormData)) then
{$IF Defined(SeattleOrBetter)}
fAllowEmptyValue := (pJson.Values[c_SwagRequestParameterAllowEmptyValue] as TJSONBool).AsBoolean;
{$ELSE}
fAllowEmptyValue := StrToBoolDef((pJson.Values[c_SwagRequestParameterAllowEmptyValue] as TJSONString).ToString, True);
{$ENDIF}

if Assigned(pJson.Values[c_SwagRequestParameterRequired]) then
begin
{$IF Defined(SeattleOrBetter)}
fRequired := (pJson.Values[c_SwagRequestParameterRequired] as TJSONBool).AsBoolean
{$ELSE}
fRequired := StrToBoolDef((pJson.Values[c_SwagRequestParameterRequired] as TJSONString).ToString, True);
{$ENDIF}
end

Swag.Doc.Path.pas
Linha 171
if Assigned(vOperationJson.Values['deprecated']) then
{$IF Defined(SeattleOrBetter)}
vOperation.Deprecated := (vOperationJson.Values['deprecated'] as TJSONBool).AsBoolean;
{$ELSE}
vOperation.Deprecated := StrToBoolDef((vOperationJson.Values['deprecated'] as TJSONString).ToString, True);
{$ENDIF}

Abs,
Ismael Faustino

@marcelojaloto
Copy link
Owner

marcelojaloto commented May 13, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants