Skip to content

validate examples - #79

Merged
SVilgelm merged 5 commits into
mainfrom
examples-validation
Dec 13, 2024
Merged

SVilgelm merged 5 commits into
mainfrom
examples-validation

Conversation

@SVilgelm

Copy link
Copy Markdown
Member
  • refactor Validator
  • validate examples and default values

fix #20

@SVilgelm
SVilgelm requested a review from Copilot December 13, 2024 06:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 16 out of 31 changed files in this pull request and generated no comments.

Files not reviewed (15)
  • components.go: Evaluated as low risk
  • example.go: Evaluated as low risk
  • callback.go: Evaluated as low risk
  • extensions.go: Evaluated as low risk
  • path_item.go: Evaluated as low risk
  • encoding.go: Evaluated as low risk
  • ref.go: Evaluated as low risk
  • oauth-flows.go: Evaluated as low risk
  • license.go: Evaluated as low risk
  • contact.go: Evaluated as low risk
  • media_type.go: Evaluated as low risk
  • header.go: Evaluated as low risk
  • link.go: Evaluated as low risk
  • info.go: Evaluated as low risk
  • external-docs.go: Evaluated as low risk
Comments suppressed due to low confidence (3)

parameter.go:180

  • [nitpick] Consider renaming the variable 'loc' to 'location' for improved readability.
func (o *Parameter) validateSpec(loc string, opts *specValidationOptions) []*validationError {

parameter.go:206

  • [nitpick] The error message for 'style' could be more descriptive. Consider changing it to 'Invalid value for 'style'. Expected one of [%s, %s, %s, %s], but got '%s''.
errs = append(errs, newValidationError(joinLoc(loc, "style"), "must be one of [%s, %s, %s, %s], but got '%s'", StyleMatrix, StyleLabel, StyleForm, StyleSimple, o.Style))

parameter.go:191

  • [nitpick] The error message for 'content' could be more descriptive. Consider changing it to 'Invalid number of items for 'content'. Expected only one item, but got '%d''.
errs = append(errs, newValidationError(joinLoc(loc, "content"), "must be only one item, but got '%d'", l))

@SVilgelm
SVilgelm force-pushed the examples-validation branch from c55c91b to 7e7370f Compare December 13, 2024 06:36
@SVilgelm
SVilgelm force-pushed the examples-validation branch from 7e7370f to 44ff6b4 Compare December 13, 2024 13:50
@SVilgelm
SVilgelm requested a review from Copilot December 13, 2024 13:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 17 out of 32 changed files in this pull request and generated 1 comment.

Files not reviewed (15)
  • example.go: Evaluated as low risk
  • components.go: Evaluated as low risk
  • encoding.go: Evaluated as low risk
  • path_item.go: Evaluated as low risk
  • extensions.go: Evaluated as low risk
  • oauth-flows.go: Evaluated as low risk
  • license.go: Evaluated as low risk
  • header.go: Evaluated as low risk
  • callback.go: Evaluated as low risk
  • link.go: Evaluated as low risk
  • info.go: Evaluated as low risk
  • contact.go: Evaluated as low risk
  • discriminator.go: Evaluated as low risk
  • external-docs.go: Evaluated as low risk
  • paths.go: Evaluated as low risk

Comment thread openapi.go Resolved
@SVilgelm
SVilgelm force-pushed the examples-validation branch from 5bb9300 to 2d0e326 Compare December 13, 2024 14:02
@SVilgelm
SVilgelm requested a review from Copilot December 13, 2024 14:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 17 out of 32 changed files in this pull request and generated no comments.

Files not reviewed (15)
  • external-docs.go: Evaluated as low risk
  • link.go: Evaluated as low risk
  • license.go: Evaluated as low risk
  • info.go: Evaluated as low risk
  • header.go: Evaluated as low risk
  • example.go: Evaluated as low risk
  • extensions.go: Evaluated as low risk
  • components.go: Evaluated as low risk
  • encoding.go: Evaluated as low risk
  • oauth-flows.go: Evaluated as low risk
  • path_item.go: Evaluated as low risk
  • paths.go: Evaluated as low risk
  • contact.go: Evaluated as low risk
  • callback.go: Evaluated as low risk
  • media_type.go: Evaluated as low risk

@SVilgelm
SVilgelm requested a review from Copilot December 13, 2024 14:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 17 out of 32 changed files in this pull request and generated no comments.

Files not reviewed (15)
  • info.go: Evaluated as low risk
  • external-docs.go: Evaluated as low risk
  • header.go: Evaluated as low risk
  • extensions.go: Evaluated as low risk
  • discriminator.go: Evaluated as low risk
  • encoding.go: Evaluated as low risk
  • example.go: Evaluated as low risk
  • path_item.go: Evaluated as low risk
  • paths.go: Evaluated as low risk
  • components.go: Evaluated as low risk
  • oauth-flows.go: Evaluated as low risk
  • callback.go: Evaluated as low risk
  • contact.go: Evaluated as low risk
  • link.go: Evaluated as low risk
  • media_type.go: Evaluated as low risk
Comments suppressed due to low confidence (1)

parameter.go:191

  • [nitpick] The error message is verbose. It should be simplified to 'must be only one item, but got '%d''.
errs = append(errs, newValidationError(joinLoc(location, "content"), "invalid number of items, expected only one item, but got '%d'", l))

@SVilgelm
SVilgelm force-pushed the examples-validation branch from 65d359b to 4d98fea Compare December 13, 2024 14:10
@SVilgelm
SVilgelm requested a review from Copilot December 13, 2024 14:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 17 out of 32 changed files in this pull request and generated no comments.

Files not reviewed (15)
  • README.md: Evaluated as low risk
  • callback.go: Evaluated as low risk
  • components.go: Evaluated as low risk
  • contact.go: Evaluated as low risk
  • discriminator.go: Evaluated as low risk
  • encoding.go: Evaluated as low risk
  • example.go: Evaluated as low risk
  • extensions.go: Evaluated as low risk
  • external-docs.go: Evaluated as low risk
  • header.go: Evaluated as low risk
  • info.go: Evaluated as low risk
  • license.go: Evaluated as low risk
  • link.go: Evaluated as low risk
  • media_type.go: Evaluated as low risk
  • oauth-flows.go: Evaluated as low risk

@SVilgelm
SVilgelm merged commit c6f48ae into main Dec 13, 2024
@SVilgelm
SVilgelm deleted the examples-validation branch December 13, 2024 14:14
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.

TODO: validate examples

2 participants

⌂ 换网址