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

Optional OpenAPI Path in CLI arguments #160

Merged
merged 5 commits into from
Sep 20, 2023
Merged

Conversation

christianhelle
Copy link
Owner

The changes here gives users the choice to specify the path or URL to the OpenAPI specifications document from either the command line argument or via the settings file specified via --settings-file

This implements #149

The settings file, "Settings.cs" needed a default value for OpenApiPath. This change sets null as the default. It helps avoid potential issues when the value is not explicitly set.
Modified the validation and input handling in GenerateCommand.cs. Initially, only a single OpenAPI path could be accepted. Now, it has been altered to also accommodate a settings file path as input. This change allows users to provide their settings directly in a file rather than passing a long list of command line arguments, improving user experience.
This commit adds a new validation in the GenerateCommand class to avoid conflicts with input sources. After this update, if the user provides both an OpenApiPath and a SettingsFilePath, the application will throw a validation error. This change is meant to ensure that the source of data is clearly defined, either directly or through a settings file.
Modified the pipeline script (smoke-tests.ps1) to use the ForEach-Object instead of the forEach alias when deleting generated C# files. This change was made to make the code more explicit and easier to understand for those unfamiliar with the shorthand syntax.
@christianhelle christianhelle added the enhancement New feature, bug fix, or request label Sep 20, 2023
@christianhelle christianhelle self-assigned this Sep 20, 2023
@sonarcloud
Copy link

sonarcloud bot commented Sep 20, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

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

No Coverage information No Coverage information
0.0% 0.0% Duplication

@codecov
Copy link

codecov bot commented Sep 20, 2023

Codecov Report

Merging #160 (6dfcc3a) into main (3cb81d1) will not change coverage.
Report is 14 commits behind head on main.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #160   +/-   ##
=======================================
  Coverage   98.40%   98.40%           
=======================================
  Files          39       39           
  Lines        1255     1255           
=======================================
  Hits         1235     1235           
  Misses          6        6           
  Partials       14       14           
Flag Coverage Δ
unittests 98.40% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@christianhelle christianhelle merged commit c7c1a33 into main Sep 20, 2023
428 checks passed
@christianhelle christianhelle deleted the optional-openapi-path branch September 20, 2023 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature, bug fix, or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Path to OpenAPI spec file is required in CLI command even when using a --settings-file parameter.
1 participant