Skip to content

Commit d45d9f5

Browse files
chore(repo): fix substring issues (#52)
* feat(repo): migrate to new space-api * chore(repo): remove pact checks until APIs are documented * chore(repo): fix name lengths
1 parent ecf6880 commit d45d9f5

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

.github/gitversion.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
next-version: 0.9.0
1+
next-version: 0.9.1
22
assembly-versioning-scheme: MajorMinorPatch
33
assembly-file-versioning-scheme: MajorMinorPatchTag
44
assembly-informational-format: '{InformationalVersion}'

src/Explore.Cli/MappingHelpers/Insomnia/InsomniaCollectionMappingHelper.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ public static ApiRequestV2 MapInsomniaResourceToApiRequestV2(Resource resource)
4242
{
4343
return new ApiRequestV2()
4444
{
45-
Name = resource.Name?.Substring(0,60) ?? string.Empty,
45+
Name = !string.IsNullOrEmpty(resource.Name)
46+
? (resource.Name.Length > 60 ? resource.Name.Substring(0, 60) : resource.Name)
47+
: string.Empty,
4648
ServerURLs = new string[] { resource?.Url?.Split("?")[0] ?? string.Empty },
4749
Description = $"Imported via Explore.CLI from Insomnia Collection. {resource?.Description ?? string.Empty}",
4850
};

src/Explore.Cli/MappingHelpers/MappingHelper.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ public static ApiRequestV2 MapStagedApiToApiRequestV2(StagedAPI stagedApi)
4141
{
4242
return new ApiRequestV2
4343
{
44-
Name = stagedApi.APIName.Substring(0, 60),
44+
Name = !string.IsNullOrEmpty(stagedApi.APIName)
45+
? (stagedApi.APIName.Length > 60 ? stagedApi.APIName.Substring(0, 60) : stagedApi.APIName)
46+
: string.Empty,
4547
ServerURLs = new string[] { stagedApi.APIUrl }
4648
};
4749
}

0 commit comments

Comments
 (0)