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

feat: document args/options schemas, fixes #157 #212

Merged
merged 1 commit into from
Aug 4, 2023
Merged

Conversation

danielgtaylor
Copy link
Owner

@danielgtaylor danielgtaylor commented Aug 4, 2023

Since the built-in --help generator only gives a name of each argument and a short text description of each option, this PR adds schema information for both to the generated description. There are two groups: 1. path parameter arguments and 2. query param / header arguments. Each is rendered as an object where the keys are the parameter name and the schema for each is shown next to it, similar to how the request/response body schemas work.

To take the example in #157, it now produces this to describe the image type argument:

Screenshot 2023-08-03 at 22 21 33

@codecov
Copy link

codecov bot commented Aug 4, 2023

Codecov Report

Merging #212 (6b1980e) into main (6b9ecae) will increase coverage by 0.12%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #212      +/-   ##
==========================================
+ Coverage   75.63%   75.76%   +0.12%     
==========================================
  Files          26       26              
  Lines        3555     3574      +19     
==========================================
+ Hits         2689     2708      +19     
  Misses        666      666              
  Partials      200      200              
Files Changed Coverage Δ
openapi/openapi.go 88.48% <100.00%> (+0.56%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6b9ecae...6b1980e. Read the comment docs.

@danielgtaylor danielgtaylor merged commit c47eb00 into main Aug 4, 2023
6 checks passed
@danielgtaylor danielgtaylor deleted the doc-args branch August 4, 2023 05:24
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

Successfully merging this pull request may close these issues.

1 participant