-
Notifications
You must be signed in to change notification settings - Fork 32
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
Comments
Olá Ismael,
Quanto tempo meu nobre. Tudo bem?
Fico muito satisfeito em estar usando o Swagdoc.
Você pode criar um pull request com as suas modificações?
Você vai aparecer como um contribuidor também para o projeto. É rapidinho.
Beleza? Aí eu aprovo e subo suas modificações.
Grande abraço!
Marcelo Jaloto
Em ter, 12 de mai de 2020 11:25, Ismael Faustino <notifications@github.com>
escreveu:
… 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
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#18>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEY6TKBHBTTOZQFXJHWJOXTRRFL3XANCNFSM4M635TGQ>
.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
The text was updated successfully, but these errors were encountered: