question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Export API schema - running into BOM complications

See original GitHub issue

Describe the bug Attempting to use apiManagementManager.inner().apiExports() .get(apimResourceGroupName, apimServiceName, id, exportFormat);

within SpringBoot

Causes an exception which indicates it fails due to inclusion of a Byte Order Mark (BOM) on Jackson transformation to an ApiExportResultInner object.

Exception or Stack Trace com.fasterxml.jackson.core.JsonParseException: Unexpected character (‘’ (code 65279 / 0xfeff)): expected a valid value (number, String, array, object, ‘true’, ‘false’ or ‘null’) at [Source: (String)‘{‘link’:‘https://apimgmtstbp9kg0aataxe9es.blob.core.windows.net/api-export/Aircraft Configuration.json?sv=2017-04-17&sr=b&sig=YwMImrNL62TK67PxmMUESoNpuo0937R0JKhvsfRRKVI%3D&se=2019-09-23T17:43:54Z&sp=r’}’; line: 1, column: 2]

To Reproduce Run the code snippets to a valid API in API Manager, with any valid ExportFormat, in my case I used swagger-link, then will see the exception, instead of the expected returned object.

Code Snippet pom.xml snippet: <dependency> <groupId>com.microsoft.azure</groupId> <artifactId>azure-mgmt-apimanagement</artifactId> <version>1.10.0-beta</version> </dependency>

code snippet: … public ApiExportModel findExportByIdAndFormat(final String id, final String format) { ExportFormat exportFormat = ExportFormat.fromString(format); ApiExportResultInner apiExportResultInner = apiManagementManager.inner().apiExports() .get(apimResourceGroupName, apimServiceName, id, exportFormat); …

controller code: … @RequestMapping(value = ‘/{id}/export/{format}’, method = RequestMethod.GET, produces = { MediaType.APPLICATION_JSON_VALUE ) public ResponseEntity<?> findExportByIdAndFormat(@PathVariable(‘id’) final String id, @PathVariable(‘format’) final String format) { try { return new ResponseEntity<>(apisService.findExportByIdAndFormat(id, format), HttpStatus.OK); } catch (Exception e) { return new ResponseEntity<>(‘Nothing found’, HttpStatus.NOT_FOUND); } } …

calling method with id = ‘aircraft-configuration’ // an API ID that works for other requests format =‘swagger-link’ // (or any ExportFormat)

Expected behavior I expected the ApiExportResultInner object to be returned from the call, but instead see the exception.

Setup (please complete the following information):

  • OS: CentOS 7.6.1810 (core)
  • IDE : STS4 - 4.4.0.RELEASE
  • Version of the Library used: openjdk 64bit 1.8.0_222-b10, azure-mgmt-apimanagement:1.10.0-beta

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
solankisamircommented, Sep 27, 2019

@d2baker we have located the issue and will deploy the fix within the next 2 weeks.

1reaction
solankisamircommented, Oct 18, 2019

yes, we have resolved the issue. By 10/21/2019 all service in national clouds should also have the fix

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to export BOM from the Pro version - EasyEDA
The problem is caused by getSmtPartInfo API query for component C460099 returning no "stock_num" attribute, while the code in function sch-main.
Read more >
Loading CSV data from Cloud Storage | BigQuery
Describes how to load CSV data from Cloud Storage to BigQuery. ... and if there are too many bad records, an invalid error...
Read more >
Bug listing with status CONFIRMED as at 2022/12/14 03:46:34
Stream audio to icecast from python." status:CONFIRMED resolution: severity:normal · Bug:47670 - "sci-mathematics/gambit-0.97.0.6.ebuild (New Package)" ...
Read more >
Fix packs for DataPower Gateway version 10.0.1.x - IBM
DATAPOWER MAY RESTART WHEN PREPARING TO COMPILE AFTER A CONFIGURATION CHANGE. IT40500, API CONNECT GATEWAY SERVICE MIGHT NOT BE USED SUCCESSFULLY FROM TENANTS....
Read more >
Categories Not Appearing in Export
Resolution: A curator will need to verify these classifications and run Update Categorizations. Updated about 1 month ago. Categorization Issues · Error when ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found