Error Saving Revision 1
XMLToJSON[{0}]: Either Options or Format must be specified.
Exemplo de captura de tela
Causa
Se um dos elementos <Options> ou <Format> não for declarado na política XML para JSON, a implantação do proxy de API falhará.
<Options> será necessário se <Format> não for usado.
Use o elemento <Format> ou o grupo de elementos <Options>. Não é possível usar <Format> e <Options> ao mesmo tempo. Os formatos predefinidos incluem: xml.com, yahoo, google e badgerFish.
Diagnóstico
Examine todas as políticas XML para JSON no proxy de API específico em que a falha ocorreu. Se houver alguma política XML para JSON em que um dos elementos <Options> ou <Format> não seja declarado, essa será a causa do erro.
Por exemplo, a política a seguir não tem um dos elementos declarado:
Se o elemento <Format> na política XML para JSON tiver um formato desconhecido, a implantação do proxy da API falhará.
Os formatos predefinidos incluem: xml.com, yahoo, google e badgerFish.
Diagnóstico
Identifique a política XML para JSON em que ocorreu o erro e o formato desconhecido. Você encontra essas informações na mensagem de erro. Por exemplo, no erro a seguir, o nome da política é WithFormat e o formato desconhecido é google.com:
Verifique se o formato desconhecido especificado na política XML para JSON de falha corresponde ao valor identificado na mensagem de erro (etapa 1 acima). Por exemplo, a seguinte política especifica o formato como google.com, que corresponde ao que está na mensagem de erro:
Se o formato especificado não estiver entre os formatos predefinidos xml.com, yahoo, google ou badgerFish, essa será a causa do erro.
No exemplo de política XML para JSON mostrado acima, o formato é google.com, que é inválido. Portanto, a implantação do proxy de API falhará com o erro:
XMLToJSON[WithFormat]:UnknownFormatgoogle.com.
Resolução
Verifique se o formato especificado no elemento <Format> da política XML para JSON
é válido. Exemplo:
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-09-04 UTC."],[[["\u003cp\u003eAPI proxy deployment fails if the XML to JSON policy lacks either the \u003ccode\u003e<Options>\u003c/code\u003e or \u003ccode\u003e<Format>\u003c/code\u003e element, as one of them is required.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003e<Format>\u003c/code\u003e element in the XML to JSON policy must contain one of the predefined formats: \u003ccode\u003exml.com\u003c/code\u003e, \u003ccode\u003eyahoo\u003c/code\u003e, \u003ccode\u003egoogle\u003c/code\u003e, or \u003ccode\u003ebadgerFish\u003c/code\u003e, or else the proxy deployment will fail.\u003c/p\u003e\n"],["\u003cp\u003eUsing both the \u003ccode\u003e<Format>\u003c/code\u003e and \u003ccode\u003e<Options>\u003c/code\u003e elements within the same XML to JSON policy is not allowed and will result in deployment failure.\u003c/p\u003e\n"],["\u003cp\u003eIf an unknown format is defined within the \u003ccode\u003e<Format>\u003c/code\u003e element of the XML to JSON policy, it will result in a proxy deployment failure with an "Unknown Format" error message.\u003c/p\u003e\n"],["\u003cp\u003eThe error message will contain the name of the policy as well as the format that caused the error.\u003c/p\u003e\n"]]],[],null,["# XML to JSON policy deployment error troubleshooting\n\n*You're viewing **Apigee** and **Apigee hybrid** documentation.\nView [Apigee Edge](https://docs.apigee.com/api-platform/troubleshoot/policies/deployment/xmltojson-deployment-errors) documentation.*\n| Was this troubleshooting playbook helpful? Please let us know by clicking [Send Feedback]().\n\nEitherOptionOrFormat\n--------------------\n\n### Error message\n\nDeployment of the API proxy through either the Apigee UI or API fails with this error message: \n\n```transact-sql\nError Saving Revision [revision_number]\nXMLToJSON[{0}]: Either Options or Format must be specified.\n```\n\n### Example error\n\n Error Saving Revision 1\n XMLToJSON[{0}]: Either Options or Format must be specified.\n\n### Example screenshot\n\n### Cause\n\nIf one of the elements `\u003cOptions\u003e` or `\u003cFormat\u003e` is not declared in the XML to JSON Policy, then the deployment of the API proxy fails.\n\n`\u003cOptions\u003e` is required if `\u003cFormat\u003e` isn't used.\n\nUse either the `\u003cFormat\u003e` element or `\u003cOptions\u003e` element group. You cannot use both `\u003cFormat\u003e` and `\u003cOptions\u003e`. Predefined formats include: `xml.com`, `yahoo`, `google`, and `badgerFish`.\n\n### Diagnosis\n\n1. Examine all the XML to JSON policies in the specific API proxy where the failure has occurred. If there is any XML to JSON policy in which either of the elements `\u003cOptions\u003e` or `\u003cFormat\u003e` is not declared, then that's the cause of the error.\n\n For example, the following policy does not have either of the elements declared: \n\n \u003c?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?\u003e\n \u003cXMLToJSON async=\"false\" continueOnError=\"false\" enabled=\"true\" name=\"XMLToJSON\"\u003e\n \u003cDisplayName\u003eXMLToJSON\u003c/DisplayName\u003e\n \u003cProperties/\u003e\n \u003cOutputVariable\u003eresponse\u003c/OutputVariable\u003e\n \u003cSource\u003eresponse\u003c/Source\u003e\n \u003c/XMLToJSON\u003e\n\n### Resolution\n\nEnsure that the XML of the XML to JSON policy has one of the elements `\u003cOptions\u003e` or `\u003cFormat\u003e` declared in the policy.\n\nExample 1: \n\n \u003c?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?\u003e\n \u003cXMLToJSON async=\"false\" continueOnError=\"false\" enabled=\"true\" name=\"XMLToJSON\"\u003e\n \u003cDisplayName\u003eXMLToJSON\u003c/DisplayName\u003e\n \u003cProperties/\u003e\n \u003cFormat\u003egoogle\u003c/Format\u003e\n \u003cOutputVariable\u003eresponse\u003c/OutputVariable\u003e\n \u003cSource\u003eresponse\u003c/Source\u003e\n \u003c/XMLToJSON\u003e\n\nExample 2: \n\n \u003c?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?\u003e\n \u003cXMLToJSON async=\"false\" continueOnError=\"false\" enabled=\"true\" name=\"XMLToJSON\"\u003e\n \u003cDisplayName\u003eXMLToJSON\u003c/DisplayName\u003e\n \u003cProperties/\u003e\n \u003cOptions\u003e\n \u003cRecognizeNumber\u003etrue\u003c/RecognizeNumber\u003e\n \u003cRecognizeBoolean\u003etrue\u003c/RecognizeBoolean\u003e\n \u003cRecognizeNull\u003etrue\u003c/RecognizeNull\u003e\n \u003c/Options\u003e\n \u003cOutputVariable\u003eresponse\u003c/OutputVariable\u003e\n \u003cSource\u003eresponse\u003c/Source\u003e\n \u003c/XMLToJSON\u003e\n\nUnknownFormat\n-------------\n\n### Error message\n\nDeployment of the API proxy through either the Apigee UI or API fails with this error message: \n\n```transact-sql\nError Saving Revision [revision_number]\nXMLToJSON[policy_name]: Unknown Format [unknown_format].\n```\n\n### Example error\n\n Error Saving Revision 1\n XMLToJSON[WithFormat]: Unknown Format google.com.\n\n### Example screenshot\n\n### Cause\n\nIf the `\u003cFormat\u003e` element within the XML to JSON policy has an unknown format defined, then the deployment of the API proxy fails.\n\nPredefined formats include: `xml.com`, `yahoo`, `google`, and `badgerFish`.\n\n### Diagnosis\n\n1. Identify the XML to JSON policy where the error occurred and the unknown format. You can find this information from the error message. For example, in the following error, the policy name is `WithFormat` and the unknown format is `google.com`:\n\n Error Saving Revision 1\n XMLToJSON[WithFormat]: Unknown Format google.com.\n\n2. Verify that the unknown format specified in the failed XML to JSON policy matches with the value identified in the error message (step #1 above). For example, the following policy specifies the format as `google.com`, which matches what's in the error message:\n\n \u003cXMLToJSON async=\"false\" continueOnError=\"false\" enabled=\"true\" name=\"WithFormat\"\u003e\n \u003cDisplayName\u003eWithFormat\u003c/DisplayName\u003e\n \u003cProperties/\u003e\n \u003cFormat\u003egoogle.com\u003c/Format\u003e\n \u003cOutputVariable\u003eresponse\u003c/OutputVariable\u003e\n \u003cSource\u003eresponse\u003c/Source\u003e\n \u003c/XMLToJSON\u003e\n\n3. If the Format specified is not one among the predefined formats `xml.com`, `yahoo`, `google`, or `badgerFish`, then that's the cause of the error.\n\n In the example XML to JSON Policy shown above, the format is `google.com` which is invalid. Therefore, the deployment of the API Proxy fails with the error: \n\n XMLToJSON[WithFormat]: Unknown Format google.com.\n\n### Resolution\n\nEnsure that the format specified in the `\u003cFormat\u003e` element of the XML to JSON policy\nis valid. For example: \n\n \u003c?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?\u003e\n \u003cXMLToJSON async=\"false\" continueOnError=\"false\" enabled=\"true\" name=\"WithFormat\"\u003e\n \u003cDisplayName\u003eWithFormat\u003c/DisplayName\u003e\n \u003cProperties/\u003e\n \u003cFormat\u003egoogle\u003c/Format\u003e\n \u003cOutputVariable\u003eresponse\u003c/OutputVariable\u003e\n \u003cSource\u003eresponse\u003c/Source\u003e\n \u003c/XMLToJSON\u003e"]]