Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate adding an option to disable the ExamplesFactory #3161

Open
GCHQDeveloper314 opened this issue Feb 15, 2024 · 0 comments
Open

Investigate adding an option to disable the ExamplesFactory #3161

GCHQDeveloper314 opened this issue Feb 15, 2024 · 0 comments
Labels
enhancement Improvement to existing functionality/feature rest-api Specific to/touches a part of the REST API
Milestone

Comments

@GCHQDeveloper314
Copy link
Member

Describe the new feature you'd like
An option to disable the REST ExamplesFactory, disabling the ability for a REST endpoint to generate example JSON.

Why do you want this feature?
When Gaffer starts, the code run by DefaultExamplesFactory (in practice AbstractExamplesFactory.java) might not be desirable. It's been reported that a lot of output can be logged in some situations. Problems with these factories can also cause an endpoint to crash on startup.

Adding a configuration option to disable would avoid these potential issues.

Additional context
For both Jersey and Spring REST, the DefaultExamplesFactory is used to provide example JSON. For Jersey this is used in the Swagger UI and the /graph/operations/details and /graph/operations/details/all endpoints. For Spring it's used only with the endpoints.

For Spring REST, the DefaultExamplesFactory is created in FactoryConfig.java. This is a point where new logic could use a dummy factory which produced only empty JSON to in effect disable this capability without requiring many other changes.

@GCHQDeveloper314 GCHQDeveloper314 added enhancement Improvement to existing functionality/feature rest-api Specific to/touches a part of the REST API labels Feb 15, 2024
@GCHQDeveloper314 GCHQDeveloper314 added this to the Backlog milestone Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement to existing functionality/feature rest-api Specific to/touches a part of the REST API
Projects
None yet
Development

No branches or pull requests

1 participant