File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -309,7 +309,7 @@ from updatedDto in JsonObjectModule.From(formattedDtoObject, resource.Serializer
309309 }
310310
311311 /// <summary>
312- /// If the API type is not 'websocket' or 'graphql' , remove the 'serviceUrl' property from the API information file DTO .
312+ /// If the 'serviceUrl' property is empty , remove it. APIM doesn't support publishing blank service URLs .
313313 /// </summary>
314314 private static JsonObject FormatInformationFileDto ( this ApiResource resource , JsonObject dtoJson )
315315 {
@@ -318,9 +318,9 @@ private static JsonObject FormatInformationFileDto(this ApiResource resource, Js
318318 var dto = JsonNodeModule . To < ApiDto > ( dtoJson , serializerOptions )
319319 . IfErrorThrow ( ) ;
320320
321- dto = new [ ] { "websocket" , "graphql" } . Contains ( dto . Properties . Type , StringComparer . OrdinalIgnoreCase )
322- ? dto
323- : dto with { Properties = dto . Properties with { ServiceUrl = null } } ;
321+ dto = string . IsNullOrWhiteSpace ( dto . Properties . ServiceUrl )
322+ ? dto with { Properties = dto . Properties with { ServiceUrl = null } }
323+ : dto ;
324324
325325 return JsonObjectModule . From ( dto , serializerOptions )
326326 . IfErrorThrow ( ) ;
You can’t perform that action at this time.
0 commit comments