Azure / Azure/oav

extract-xmsexamples failed generation

Open
#450 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
104
Forks
62
Avg merge
2d 12h
Merged PRs (30d)
5

Description

I've been trying to run oav extract-xmsexamples to get examples for our swagger spec . To this point I am using session recordings I generated using the Azure .Net Sdk Test framework (As I had been previously told this was carried out). Nonetheless this seems to fail with the below log. Any ideas if this may be a bug/ I just cant figure out how to use this properly? I can also provide more files and detail if they'll help.

```log
oav extract-xmsexamples ./containerregistry.json C:/Users/t-esre/Documents/GitHub/azure-cr/azure-sdk-for-net/sdk/containerregistry/Microsoft.Azure.ContainerRegistry/tests/SessionRecords
{ message:
'Error processing recording file: "C:\\Users\\t-esre\\Documents\\GitHub\\azure-cr\\azure-sdk-for-net\\sdk\\containerregistry\\Microsoft.Azure.ContainerRegistry\\tests\\SessionRecords\\ContainerRegistry.Tests.AuthTests\\GetAcrAccessToken.json"',
level: '\u001b[33mwarn\u001b[39m' }
{ message:
'Error: "TypeError: Cannot read property \'slice\' of undefined "',
level: '\u001b[33mwarn\u001b[39m' }
{ message:
'Writing updated swagger with x-ms-examples at c:\\Users\\t-esre\\Documents\\GitHub\\azure-cr\\azure-rest-api-specs\\specification\\containerregistry\\data-plane\\Microsoft.ContainerRegistry\\preview\\2019-08-15\\output\\swagger\\containerregistry.json',
level: '\u001b[32minfo\u001b[39m' }
{ message:
'Error processing recording file: "C:\\Users\\t-esre\\Documents\\GitHub\\azure-cr\\azure-sdk-for-net\\sdk\\containerregistry\\Microsoft.Azure.ContainerRegistry\\tests\\SessionRecords\\ContainerRegistry.Tests.AuthTests\\GetAcrRefreshTokenFromExchange.json"',
level: '\u001b[33mwarn\u001b[39m' }
{ message:
'Error: "TypeError: Cannot read property \'slice\' of undefined "',
level: '\u001b[33mwarn\u001b[39m' }
{ message:
'Error processing recording file: "C:\\Users\\t-esre\\Documents\\GitHub\\azure-cr\\azure-sdk-for-net\\sdk\\containerregistry\\Microsoft.Azure.ContainerRegistry\\tests\\SessionRecords\\ContainerRegistry.Tests.ManifestTests\\CreateAcrManifest.json"',
level: '\u001b[33mwarn\u001b[39m' }
{ message:
'Error: "TypeError: Cannot read property \'slice\' of undefined "',
level: '\u001b[33mwarn\u001b[39m' }
{ message:
'Error processing recording file: "C:\\Users\\t-esre\\Documents\\GitHub\\azure-cr\\azure-sdk-for-net\\sdk\\containerregistry\\Microsoft.Azure.ContainerRegistry\\tests\\SessionRecords\\ContainerRegistry.Tests.ManifestTests\\CreateAndDeletecrManifest.json"',
level: '\u001b[33mwarn\u001b[39m' }
{ message:
'Error: "TypeError: Cannot read property \'slice\' of undefined "',
level: '\u001b[33mwarn\u001b[39m' }
{ message:
'Error processing recording file: "C:\\Users\\t-esre\\Documents\\GitHub\\azure-cr\\azure-sdk-for-net\\sdk\\containerregistry\\Microsoft.Azure.ContainerRegistry\\tests\\SessionRecords\\ContainerRegistry.Tests.ManifestTests\\CreateAndDeleteManifest.json"',
level: '\u001b[33mwarn\u001b[39m' }
{ message:
'Error: "TypeError: Cannot read property \'slice\' of undefined "',
level: '\u001b[33mwarn\u001b[39m' }
{ message:
'Error processing recording file: "C:\\Users\\t-esre\\Documents\\GitHub\\azure-cr\\azure-sdk-for-net\\sdk\\containerregistry\\Microsoft.Azure.ContainerRegistry\\tests\\SessionRecords\\ContainerRegistry.Tests.ManifestTests\\DeleteAcrManifest.json"',
level: '\u001b[33mwarn\u001b[39m' }
{ message:
'Error: "TypeError: Cannot read property \'slice\' of undefined "',
level: '\u001b[33mwarn\u001b[39m' }
{ message:
'Error processing recording file: "C:\\Users\\t-esre\\Documents\\GitHub\\azure-cr\\azure-sdk-for-net\\sdk\\containerregistry\\Microsoft.Azure.ContainerRegistry\\tests\\SessionRecords\\ContainerRegistry.Tests.ManifestTests\\GetAcrManifestAttributes.json"',
level: '\u001b[33mwarn\u001b[39m' }
{ message:
'Error: "TypeError: Cannot read property \'slice\' of undefined "',
level: '\u001b[33mwarn\u001b[39m' }
{ message:
'Error processing recording file: "C:\\Users\\t-esre\\Documents\\GitHub\\azure-cr\\azure-sdk-for-net\\sdk\\containerregistry\\Microsoft.Azure.ContainerRegistry\\tests\\SessionRecords\\ContainerRegistry.Tests.ManifestTests\\GetAcrManifests.json"',
level: '\u001b[33mwarn\u001b[39m' }
{ message:
'Error: "TypeError: Cannot read property \'slice\' of undefined "',
level: '\u001b[33mwarn\u001b[39m' }
{ message:
'Error processing recording file: "C:\\Users\\t-esre\\Documents\\GitHub\\azure-cr\\azure-sdk-for-net\\sdk\\containerregistry\\Microsoft.Azure.ContainerRegistry\\tests\\SessionRecords\\ContainerRegistry.Tests.ManifestTests\\GetV1Manifest.json"',
level: '\u001b[33mwarn\u001b[39m' }
{ message:
'Error: "TypeError: Cannot read property \'slice\' of undefined "',
level: '\u001b[33mwarn\u001b[39m' }
{ message:
'Error processing recording file: "C:\\Users\\t-esre\\Documents\\GitHub\\azure-cr\\azure-sdk-for-net\\sdk\\containerregistry\\Microsoft.Azure.ContainerRegistry\\tests\\SessionRecords\\ContainerRegistry.Tests.ManifestTests\\GetV2Manifest.json"',
level: '\u001b[33mwarn\u001b[39m' }
{ message:
'Error: "TypeError: Cannot read property \'slice\' of undefined "',
level: '\u001b[33mwarn\u001b[39m' }
{ message:
'Error processing recording file: "C:\\Users\\t-esre\\Documents\\GitHub\\azure-cr\\azure-sdk-for-net\\sdk\\containerregistry\\Microsoft.Azure.ContainerRegistry\\tests\\SessionRecords\\ContainerRegistry.Tests.ManifestTests\\UpdateAcrManifestAttributes.json"',
level: '\u001b[33mwarn\u001b[39m' }
{ message:
'Error: "TypeError: Cannot read property \'slice\' of undefined "',
level: '\u001b[33mwarn\u001b[39m' }
{ message:
'Error processing recording file: "C:\\Users\\t-esre\\Documents\\GitHub\\azure-cr\\azure-sdk-for-net\\sdk\\containerregistry\\Microsoft.Azure.ContainerRegistry\\tests\\SessionRecords\\ContainerRegistry.Tests.RepositoryTests\\DeleteAcrRepository.json"',
level: '\u001b[33mwarn\u001b[39m' }
{ message:
'Error: "TypeError: Cannot read property \'slice\' of undefined "',
level: '\u001b[33mwarn\u001b[39m' }
{ message:
'Error processing recording file: "C:\\Users\\t-esre\\Documents\\GitHub\\azure-cr\\azure-sdk-for-net\\sdk\\containerregistry\\Microsoft.Azure.ContainerRegistry\\tests\\SessionRecords\\ContainerRegistry.Tests.RepositoryTests\\GetAcrRepositories.json"',
level: '\u001b[33mwarn\u001b[39m' }
{ message:
'Error: "TypeError: Cannot read property \'slice\' of undefined "',
annot read property \'slice\' of undefined","C:\\\\Users\\\\t-esre\\\\Documents\\\\GitHub\\\\azure-cr\\\\azure-sdk-for-net\\\\sdk\\\\containerregistry\\\\Microsoft.Azure.ContainerRegistry\\\\tests\\\\SessionRecords\\\\ContainerRegistry.Tests.ManifestTests\\\\DeleteAcrManifest.json":"TypeError: Cannot read property \'slice\' of undefined","C:\\\\Users\\\\t-esre\\\\Documents\\\\GitHub\\\\azure-cr\\\\azure-sdk-for-net\\\\sdk\\\\containerregistry\\\\Microsoft.Azure.ContainerRegistry\\\\tests\\\\SessionRecords\\\\ContainerRegistry.Tests.ManifestTests\\\\GetAcrManifestAttributes.json":"TypeError: Cannot read property \'slice\' of undefined","C:\\\\Users\\\\t-esre\\\\Documents\\\\GitHub\\\\azure-cr\\\\azure-sdk-for-net\\\\sdk\\\\containerregistry\\\\Microsoft.Azure.ContainerRegistry\\\\tests\\\\SessionRecords\\\\ContainerRegistry.Tests.ManifestTests\\\\GetAcrManifests.json":"TypeError: Cannot read property \'slice\' of undefined","C:\\\\Users\\\\t-esre\\\\Documents\\\\GitHub\\\\azure-cr\\\\azure-sdk-for-net\\\\sdk\\\\containerregistry\\\\Microsoft.Azure.ContainerRegistry\\\\tests\\\\SessionRecords\\\\ContainerRegistry.Tests.ManifestTests\\\\GetV1Manifest.json":"TypeError: Cannot read property \'slice\' of undefined","C:\\\\Users\\\\t-esre\\\\Documents\\\\GitHub\\\\azure-cr\\\\azure-sdk-for-net\\\\sdk\\\\containerregistry\\\\Microsoft.Azure.ContainerRegistry\\\\tests\\\\SessionRecords\\\\ContainerRegistry.Tests.ManifestTests\\\\GetV2Manifest.json":"TypeError: Cannot read property \'slice\' of undefined","C:\\\\Users\\\\t-esre\\\\Documents\\\\GitHub\\\\azure-cr\\\\azure-sdk-for-net\\\\sdk\\\\containerregistry\\\\Microsoft.Azure.ContainerRegistry\\\\tests\\\\SessionRecords\\\\ContainerRegistry.Tests.ManifestTests\\\\UpdateAcrManifestAttributes.json":"TypeError: Cannot read property \'slice\' of undefined","C:\\\\Users\\\\t-esre\\\\Documents\\\\GitHub\\\\azure-cr\\\\azure-sdk-for-net\\\\sdk\\\\containerregistry\\\\Microsoft.Azure.ContainerRegistry\\\\tests\\\\SessionRecords\\\\ContainerRegistry.Tests.RepositoryTests\\\\DeleteAcrRepository.json":"TypeError: Cannot read property \'slice\' of undefined","C:\\\\Users\\\\t-esre\\\\Documents\\\\GitHub\\\\azure-cr\\\\azure-sdk-for-net\\\\sdk\\\\containerregistry\\\\Microsoft.Azure.ContainerRegistry\\\\tests\\\\SessionRecords\\\\ContainerRegistry.Tests.RepositoryTests\\\\GetAcrRepositories.json":"TypeError: Cannot read property \'slice\' of undefined","C:\\\\Users\\\\t-esre\\\\Documents\\\\GitHub\\\\azure-cr\\\\azure-sdk-for-net\\\\sdk\\\\containerregistry\\\\Microsoft.Azure.ContainerRegistry\\\\tests\\\\SessionRecords\\\\ContainerRegistry.Tests.RepositoryTests\\\\GetAcrRepositoryDetails.json":"TypeError: Cannot read property \'slice\' of undefined","C:\\\\Users\\\\t-esre\\\\Documents\\\\GitHub\\\\azure-cr\\\\azure-sdk-for-net\\\\sdk\\\\containerregistry\\\\Microsoft.Azure.ContainerRegistry\\\\tests\\\\SessionRecords\\\\ContainerRegistry.Tests.RepositoryTests\\\\UpdateAcrRepositoryAttributes.json":"TypeError: Cannot read property \'slice\' of undefined","C:\\\\Users\\\\t-esre\\\\Documents\\\\GitHub\\\\azure-cr\\\\azure-sdk-for-net\\\\sdk\\\\containerregistry\\\\Microsoft.Azure.ContainerRegistry\\\\tests\\\\SessionRecords\\\\ContainerRegistry.Tests.TagTests\\\\DeleteAcrTag.json":"TypeError: Cannot read property \'slice\' of undefined","C:\\\\Users\\\\t-esre\\\\Documents\\\\GitHub\\\\azure-cr\\\\azure-sdk-for-net\\\\sdk\\\\containerregistry\\\\Microsoft.Azure.ContainerRegistry\\\\tests\\\\SessionRecords\\\\ContainerRegistry.Tests.TagTests\\\\GetAcrTagAttributes.json":"TypeError: Cannot read property \'slice\' of undefined","C:\\\\Users\\\\t-esre\\\\Documents\\\\GitHub\\\\azure-cr\\\\azure-sdk-for-net\\\\sdk\\\\containerregistry\\\\Microsoft.Azure.ContainerRegistry\\\\tests\\\\SessionRecords\\\\ContainerRegistry.Tests.TagTests\\\\GetAcrTags.json":"TypeError: Cannot read property \'slice\' of undefined","C:\\\\Users\\\\t-esre\\\\Documents\\\\GitHub\\\\azure-cr\\\\azure-sdk-for-net\\\\sdk\\\\containerregistry\\\\Microsoft.Azure.ContainerRegistry\\\\tests\\\\SessionRecords\\\\ContainerRegistry.Tests.TagTests\\\\GetTags.json":"TypeError: Cannot read property \'slice\' of undefined","C:\\\\Users\\\\t-esre\\\\Documents\\\\GitHub\\\\azure-cr\\\\azure-sdk-for-net\\\\sdk\\\\containerregistry\\\\Microsoft.Azure.ContainerRegistry\\\\tests\\\\SessionRecords\\\\ContainerRegistry.Tests.TagTests\\\\UpdateAcrTagAttributes.json":"TypeError: Cannot read property \'slice\' of undefined"}',
level: '\u001b[31merror\u001b[39m' }
```

Contributor guide

Open the contributing guide

Research direction

Start by running `oav extract-xmsexamples` with `containerregistry.json` and the referenced `SessionRecords` directory. Inspect the failing recordings, including `GetAcrAccessToken.json` and the ManifestTests and RepositoryTests files, along with the `extract-xmsexamples` entry point. Done means the recordings are processed without the `slice` error and the swagger file is updated with the expected x-ms-examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, typescript
Domain
api, cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.