Problema com TJSONBool no XE7
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
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 [email protected] 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 https://github.com/marcelojaloto/SwagDoc/issues/18, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEY6TKBHBTTOZQFXJHWJOXTRRFL3XANCNFSM4M635TGQ .