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

Standard documentation fields for response objects #10

Open
pieter-senden opened this issue Oct 4, 2024 · 0 comments
Open

Standard documentation fields for response objects #10

pieter-senden opened this issue Oct 4, 2024 · 0 comments

Comments

@pieter-senden
Copy link
Collaborator

Context

If a response POJO changes, then all documentation tests using that object have to be updated. This yields a lot of manual work.

Idea

Implement an inspector to check which response POJOs are updated, which tests should thus be updated, and which effectively updates them.

Proposed solution

Step 1

Suppose we have a response POJO, say, BookResponse:

public record BookResponse(UUID id, String title, String author){}

The plugin then creates a test class BookResponseDocumentation with a static method yielding a list of FieldDescriptors for each field in BookResponse.

If such a class already exists, the plugin verifies if each field in BookResponse is present in BookResponseDocumentation and provides the functionality to update if necessary.

Step 2

Given this BookResponseDocumentation class, the plugin uses its static method in the responseFields() method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant