Failed to load API definition

Trying to view the swaggerdefinition of the litium admin API but get this error.
Could it be something we messaed up in sour solution or is this i known bug that is fixed i later versions?
There is no problem viewing the ERP API

Fetch error undefined /Litium/oas/litium-admin/openapi.json

Litium version: 7.4.2

Can you see any additional information if you look at the request for openapi.json in the Network tab?

only that we get 500 error {“message”:“An error has occurred.”}

Any error in event log or in litium.log?
Is it an upgraded version?

It may be associated with https://docs.litium.com/support/bugs/bug_details?id=52436 and a stacktrace may help to identify the problem.

its a litium 7.4.2 accelerator from the start so no upgrade but we have now upgraded to litium 7.6.1

Now locking in the log i see this error that possible can be related.
The name ‘FieldOption.ProductArea.Antall-løp’ is not matching the allowed pattern ‘[1]+$’.

System.Exception: The name 'FieldOption.ProductArea.Antall-løp' is not matching the allowed pattern '^[a-zA-Z0-9\.\-_]+$'.
   at Litium.Web.OpenApi.Extensions.TypeExtensions.GetSchemaId(KeyValuePair`2 item)
   at Litium.Web.OpenApi.Controllers.OpenApiDocumentBuilderImpl.<>c.<SortOpenApiItems>b__28_3(KeyValuePair`2 x)
   at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
   at Litium.Web.OpenApi.Controllers.OpenApiDocumentBuilderImpl.SortOpenApiItems(OpenApiDocument document)
   at Litium.Web.OpenApi.Controllers.OpenApiDocumentBuilderImpl.Build()
   at Litium.Web.OpenApi.Controllers.OpenApiController.Invoke[T](String collection, String apiVersion, Decimal oasVersion)
   at Litium.Web.OpenApi.Controllers.OpenApiController.GetOpenApiJson(String collection, String apiVersion)
   at lambda_method(Closure , Object , Object[] )
   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass6_2.<GetExecutor>b__2(Object instance, Object[] methodParameters)
   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)

  1. a-zA-Z0-9.-_ ↩︎

I know it is a bad fieldname but is is strange that you can create field with non allowed pattern

After removing 20+ field with non-allowed chars i got the swagger ui working.
I have reported it as a bug that you can set a field Id that is now allowed

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.