Usage Notes

Not all of the REST API exposed by the REST API (Restful Objects viewer) is included in the Swagger schema definition files; the emphasis is those REST resources that are used to develop custom apps: domain objects, domain object collections and action invocations.

When combined with Apache Causeway' own simplified representations, these are pretty much all that is needed for this use case.

The service is_not_ (currently) used by the framework itself; it is provided as a convenience for developers to build REST applications.

See also

  • SwaggerServiceMenu

    part of the REST API (Restful Objects viewer), this provides a prototype action that enables the swagger spec to be downloaded from theUI.

  • SwaggerExporter

    can be used to generate a Swagger spec, for example within a test suite or larger build pipeline.

    An example of its use can be found in the reference app:

    SwaggerExport_IntegTest.java
    @Import({
            CausewayModuleViewerRestfulObjectsJaxrsResteasy4.class
    })
    class SwaggerExport_IntegTest extends ApplicationIntegTestAbstract {
    
        @Inject ServiceRegistry serviceRegistry;
    
        @Test
        void export() throws IOException {
            val swaggerExporter = new SwaggerExporter(serviceRegistry);
            swaggerExporter.export(Visibility.PRIVATE, Format.JSON);
        }
    }