diff --git a/.github/gitversion.yml b/.github/gitversion.yml index 67c0a3e..9f1a14e 100644 --- a/.github/gitversion.yml +++ b/.github/gitversion.yml @@ -1,4 +1,4 @@ -next-version: 0.9.0 +next-version: 0.9.1 assembly-versioning-scheme: MajorMinorPatch assembly-file-versioning-scheme: MajorMinorPatchTag assembly-informational-format: '{InformationalVersion}' diff --git a/src/Explore.Cli/MappingHelpers/Insomnia/InsomniaCollectionMappingHelper.cs b/src/Explore.Cli/MappingHelpers/Insomnia/InsomniaCollectionMappingHelper.cs index c824659..bccfd93 100644 --- a/src/Explore.Cli/MappingHelpers/Insomnia/InsomniaCollectionMappingHelper.cs +++ b/src/Explore.Cli/MappingHelpers/Insomnia/InsomniaCollectionMappingHelper.cs @@ -42,7 +42,9 @@ public static ApiRequestV2 MapInsomniaResourceToApiRequestV2(Resource resource) { return new ApiRequestV2() { - Name = resource.Name?.Substring(0,60) ?? string.Empty, + Name = !string.IsNullOrEmpty(resource.Name) + ? (resource.Name.Length > 60 ? resource.Name.Substring(0, 60) : resource.Name) + : string.Empty, ServerURLs = new string[] { resource?.Url?.Split("?")[0] ?? string.Empty }, Description = $"Imported via Explore.CLI from Insomnia Collection. {resource?.Description ?? string.Empty}", }; diff --git a/src/Explore.Cli/MappingHelpers/MappingHelper.cs b/src/Explore.Cli/MappingHelpers/MappingHelper.cs index 7bfa8e2..70143a9 100644 --- a/src/Explore.Cli/MappingHelpers/MappingHelper.cs +++ b/src/Explore.Cli/MappingHelpers/MappingHelper.cs @@ -41,7 +41,9 @@ public static ApiRequestV2 MapStagedApiToApiRequestV2(StagedAPI stagedApi) { return new ApiRequestV2 { - Name = stagedApi.APIName.Substring(0, 60), + Name = !string.IsNullOrEmpty(stagedApi.APIName) + ? (stagedApi.APIName.Length > 60 ? stagedApi.APIName.Substring(0, 60) : stagedApi.APIName) + : string.Empty, ServerURLs = new string[] { stagedApi.APIUrl } }; }