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

Use Test Examples as the placeholder for SwaggerUI? #930

Open
krowvin opened this issue Oct 24, 2024 · 1 comment
Open

Use Test Examples as the placeholder for SwaggerUI? #930

krowvin opened this issue Oct 24, 2024 · 1 comment
Labels
discussion-point Something to talk about but take no action yet documentation Improvements or additions to documentation

Comments

@krowvin
Copy link
Collaborator

krowvin commented Oct 24, 2024

When going about learning a new endpoint I find myself going between the tests, what I think something should be, and guesswork/error responses.

If possible can we start placing (or go back) and place the test examples like this one:

InputStream resource = this.getClass().getResourceAsStream("/cwms/cda/api/spk/text_ts_create_reg.json");

and its contents:
https://github.com/USACE/cwms-data-api/blob/develop/cwms-data-api/src/test/resources/cwms/cda/api/spk/text_ts_create_reg.json

That would go a long way in giving users an idea on how something might work. (Especially POST bodies)

Things I ran into just trying to run this endpoint were

  1. Realizing it should actually be a valid TSID (whoops)
  2. Making sure the time I set for it matches the interval I provided
  3. Realizing what all is actually required vs what the example provided

This way the tests also test every input as well (instead of doing the minimum)

Thought of this when trying to figure out

@krowvin krowvin added documentation Improvements or additions to documentation discussion-point Something to talk about but take no action yet labels Oct 24, 2024
@MikeNeilson
Copy link
Contributor

I think part of the sentence just before "that would go a long way" is missing.

Are you asking those be included in the examples on Swagger? If yes, I don't dissagree, but I've had some issues with the settings the example data. Though I think for this one it should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion-point Something to talk about but take no action yet documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants