Skip to content

Commit

Permalink
Keep the old behaviour for unkown content types
Browse files Browse the repository at this point in the history
For unknown content-types use the same logic as for
application/vnd.ms-azure-apim.xsd+xml and others. In case new content types will
appear, there is some chance, that this will be desired behaviour.

If future prove us wrong, then it will be easy to identify place requiring
change due to WARN logging.
  • Loading branch information
wiktorn committed Jun 17, 2021
1 parent 585c310 commit 1460888
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ func resourceApiManagementApiSchemaRead(d *pluginsdk.ResourceData, meta interfac
case "application/vnd.ms-azure-apim.xsd+xml", "application/vnd.ms-azure-apim.wadl.grammars+xml":
d.Set("value", documentProperties.Value)
default:
return fmt.Errorf("[FATAL] Unknown content type %q for schema %q (API Management Service %q / API %q / Resource Group %q)", *properties.ContentType, schemaID, serviceName, apiName, resourceGroup)
log.Printf("[WARN] Unknown content type %q for schema %q (API Management Service %q / API %q / Resource Group %q)", *properties.ContentType, schemaID, serviceName, apiName, resourceGroup)
d.Set("value", documentProperties.Value)
}
}
}
Expand Down

0 comments on commit 1460888

Please sign in to comment.