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

adds input parameters validation #168

Merged
merged 12 commits into from
May 27, 2021
Merged

adds input parameters validation #168

merged 12 commits into from
May 27, 2021

Conversation

baywet
Copy link
Member

@baywet baywet commented May 20, 2021

  • adds validation for language, loglevel, namespace and class name parameters
  • adds shorthand for loglevel and description parameters
  • adds validation for path parameters

fixes #127

@baywet baywet added this to the Alpha milestone May 20, 2021
@baywet baywet self-assigned this May 20, 2021
@baywet baywet enabled auto-merge May 20, 2021 19:09
@baywet
Copy link
Member Author

baywet commented May 20, 2021

For information there's no diff in terms or generation.
This PR brings more user friendly messages like:

  • Could not open/create output directory X:\oinoinoin, reason: Could not find a part of the path 'X:\oinoinoin'.
  • Could not open the file at C:\sources\github\kiota\src\kiota\openapi.yml, reason Could not find file 'C:\sources\github\kiota\src\kiota\openapi.yml'.
  • ruby is not a supported generation language, supported values are CSharp, Java, TypeScript, PHP, Python, Go
  • dangerousis not a supported generation log level, supported values are Trace, Debug, Information, Warning, Error, Critical, None
  • ,charp is not a valid class name for the client, the class name must conform to ^[a-zA-Z_][\w_-]+
  • ,charp is not a valid namespace name for the client, the namespace name must conform to ^[a-zA-Z_][\w._-]+

Instead of throwing exceptions at people.

@baywet baywet force-pushed the feature/input-validation branch from 1290efb to e8a6001 Compare May 25, 2021 19:01
src/Kiota.Builder/KiotaBuilder.cs Show resolved Hide resolved
src/kiota/KiotaHost.cs Outdated Show resolved Hide resolved
src/kiota/KiotaHost.cs Outdated Show resolved Hide resolved
src/kiota/KiotaHost.cs Outdated Show resolved Hide resolved
src/kiota/KiotaHost.cs Outdated Show resolved Hide resolved
src/kiota/KiotaHost.cs Outdated Show resolved Hide resolved
src/kiota/KiotaHost.cs Outdated Show resolved Hide resolved
src/kiota/KiotaHost.cs Show resolved Hide resolved
tests/Kiota.Tests/KiotaHostTests.cs Outdated Show resolved Hide resolved
tests/Kiota.Tests/KiotaHostTests.cs Show resolved Hide resolved
@baywet baywet force-pushed the feature/input-validation branch from e8a6001 to 0d55b90 Compare May 26, 2021 11:49
@baywet baywet requested a review from MIchaelMainer May 26, 2021 11:49
@baywet baywet requested a review from zengin May 26, 2021 18:43
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

97.7% 97.7% Coverage
0.0% 0.0% Duplication

@baywet baywet merged commit 69b8ce9 into main May 27, 2021
@baywet baywet deleted the feature/input-validation branch May 27, 2021 20: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.

better input parameters validation
3 participants