mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 05:01:07 +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);
|
.withChild(exampleTable);
|
||||||
exampleInstance.addApp(exampleApp);
|
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()), () ->
|
QContext.withTemporaryContext(new CapturedContext(exampleInstance, new QSystemUserSession()), () ->
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@ -256,10 +262,10 @@ public class MetaDataSpecV1 extends AbstractEndpointSpec<MetaDataInput, MetaData
|
|||||||
}
|
}
|
||||||
catch(Exception e)
|
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("""
|
return new BasicResponse("""
|
||||||
Overall metadata for the application.""",
|
Overall metadata for the application.""",
|
||||||
|
Reference in New Issue
Block a user