mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-17 20:50:44 +00:00
Add a double-wrap of tempContexts around the example call to MetaDataAction for the example, to avoid warning about creating a system-user session w/o an instance in context.
This commit is contained in:
@ -242,6 +242,12 @@ public class MetaDataSpecV1 extends AbstractEndpointSpec<MetaDataInput, MetaData
|
||||
.withChild(exampleTable);
|
||||
exampleInstance.addApp(exampleApp);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// double-wrap the context here, so the instance will exist when the system-user-session is created //
|
||||
// to avoid warnings out of system-user-session about there not being an instance in context. //
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
QContext.withTemporaryContext(new CapturedContext(exampleInstance, null), () ->
|
||||
{
|
||||
QContext.withTemporaryContext(new CapturedContext(exampleInstance, new QSystemUserSession()), () ->
|
||||
{
|
||||
try
|
||||
@ -256,10 +262,10 @@ public class MetaDataSpecV1 extends AbstractEndpointSpec<MetaDataInput, MetaData
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
examples.put("Example", new Example().withValue("Error building example: " + e.getMessage())
|
||||
);
|
||||
examples.put("Example", new Example().withValue("Error building example: " + e.getMessage()));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
return new BasicResponse("""
|
||||
Overall metadata for the application.""",
|
||||
|
Reference in New Issue
Block a user