Skip to content

Commit

Permalink
doc: Add a disclaimer to the top of the Transmodel Schema served at r…
Browse files Browse the repository at this point in the history
…untime.
  • Loading branch information
t2gran committed Dec 10, 2024
1 parent 7266bdf commit f765199
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@
@Produces(MediaType.APPLICATION_JSON)
public class TransmodelAPI {

// Note, the blank line at the end is intended
private static final String SCHEMA_DOC_HEADER =
"""
# THIS IS NOT INTENDED FOR PRODUCTION USE. We recommend using the GraphQL introspection instead.
# This is intended for the OTP Debug UI and can also be used by humans to get the schema with the
# OTP configured default-values injected.
""";

private static final Logger LOG = LoggerFactory.getLogger(TransmodelAPI.class);

private static GraphQLSchema schema;
Expand Down Expand Up @@ -143,7 +152,8 @@ public Response getGraphQL(String query, @Context HttpHeaders headers) {
@GET
@Path("schema.graphql")
public Response getGraphQLSchema() {
return Response.ok().encoding("UTF-8").entity(new SchemaPrinter().print(schema)).build();
var text = SCHEMA_DOC_HEADER + new SchemaPrinter().print(schema);
return Response.ok().encoding("UTF-8").entity(text).build();
}

private static Iterable<Tag> getTagsFromHeaders(HttpHeaders headers) {
Expand Down

0 comments on commit f765199

Please sign in to comment.