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

Add descriptions to PaginationMetadataSchema #388

Open
DashKenny opened this issue Aug 5, 2022 · 2 comments
Open

Add descriptions to PaginationMetadataSchema #388

DashKenny opened this issue Aug 5, 2022 · 2 comments

Comments

@DashKenny
Copy link

DashKenny commented Aug 5, 2022

When upgrading a service to [email protected], it came with upgrading to [email protected]. Then, when running our openapi linting step, the following came up:

+ flask openapi write openapi.json     
+ spectral lint openapi.json --fail-severity=warn                                                                                                                
OpenAPI 3.x detected                                                                                                                                             
                                                                                                                                                                 
<...>/openapi.json                                                                                                                 
 2218:28  warning  oas3-unused-components-schema  Potentially unused components schema has been detected.  components.schemas.PaginationMetadata                 
 2221:19    error  property-description           Property must have a description.                        components.schemas.PaginationMetadata.properties.total
 2224:25    error  property-description           Property must have a description.                        components.schemas.PaginationMetadata.properties.total
_pages                                                                                                                                                           
 2227:24    error  property-description           Property must have a description.                        components.schemas.PaginationMetadata.properties.first
_page                                                                                                                                                            
 2230:23    error  property-description           Property must have a description.                        components.schemas.PaginationMetadata.properties.last_
page                                                                                                                                                             
 2233:18    error  property-description           Property must have a description.                        components.schemas.PaginationMetadata.properties.page 
 2236:27    error  property-description           Property must have a description.                        components.schemas.PaginationMetadata.properties.previ
ous_page                                                                                                                                                         
 2239:23    error  property-description           Property must have a description.                        components.schemas.PaginationMetadata.properties.next_
page                                                                                                                                                             
                                                                                                                                                                 
✖ 8 problems (7 errors, 1 warning, 0 infos, 0 hints)

I think the fix is simple and just requires adding a metadata['description'] to the fields here. This is also happening because we enforce having a description on our open api fields. Seems it would be a harmless update so I can put up a PR later probably, just wanted to log this and see what others think. I can also just ignore the error in the mean time :)

@DashKenny
Copy link
Author

Tried creating a PR but got some permission issues. I did follow along with CONTRIBUTING.rst as well.

@lafrech
Copy link
Member

lafrech commented Oct 16, 2022

Hi.

You may send a PR with field description.

You shouldn't have permission issues creating a PR.

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

No branches or pull requests

2 participants