Skip to content

Commit

Permalink
[IDP-1044] Update ruleset (#43)
Browse files Browse the repository at this point in the history
* Update ruleset (Breaking Changes)

---------

Co-authored-by: Mathieu Gamache <[email protected]>
  • Loading branch information
PrincessMadMath and Mathieu Gamache authored Mar 20, 2024
1 parent 7d5a6d2 commit b814c43
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<OpenApiToolsDirectoryPath Condition="'$(OpenApiToolsDirectoryPath)' == ''">$(StartupAssemblyPath)openapi</OpenApiToolsDirectoryPath>

<!-- The URL of the OpenAPI Spectral ruleset to validate against -->
<OpenApiSpectralRulesetUrl Condition="'$(OpenApiSpectralRulesetUrl)' == ''">https://raw.githubusercontent.com/gsoft-inc/wl-api-guidelines/0.1.0/.spectral.yaml</OpenApiSpectralRulesetUrl>
<OpenApiSpectralRulesetUrl Condition="'$(OpenApiSpectralRulesetUrl)' == ''">https://raw.githubusercontent.com/gsoft-inc/wl-api-guidelines/0.4.0/.spectral.yaml</OpenApiSpectralRulesetUrl>

<!-- The names of the Swagger documents to generate OpenAPI specifications for -->
<!-- "v1" is the default Swagger document name. Users can specify multiple values separated by semicolons -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public WeatherManagementController(ILogger<WeatherManagementController> logger)
[HttpGet(Name = "GetWeatherSources")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status403Forbidden)]
public IEnumerable<string> Get()
public IEnumerable<WeatherSource> Get()
{
return Sources;
return Sources.Select(x => new WeatherSource { Source = x });
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace WebApi.MsBuild.SystemTest;

public class WeatherSource
{
public required string Source { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ public class WeatherManagementController : ControllerBase
{
"Accuweather", "AerisWeather", "Foreca", "Open Weathermap", "National Oceanic and Atmospheric Administration",
};

private readonly ILogger<WeatherManagementController> _logger;

public WeatherManagementController(ILogger<WeatherManagementController> logger)
{
this._logger = logger;
}

[HttpGet(Name = "GetWeatherSources")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status403Forbidden)]
public IEnumerable<string> Get()
public IEnumerable<WeatherSource> Get()
{
return Sources;
return Sources.Select(x => new WeatherSource { Source = x });
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace WebApi.MsBuild.SystemTest;

public class WeatherSource
{
public required string Source { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ paths:
schema:
type: array
items:
type: string
$ref: '#/components/schemas/WeatherSource'
'403':
description: Forbidden
content:
Expand Down Expand Up @@ -44,4 +44,11 @@ components:
instance:
type: string
nullable: true
additionalProperties: {}
additionalProperties: { }
WeatherSource:
type: object
properties:
source:
type: string
nullable: true
additionalProperties: false
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ components:
instance:
type: string
nullable: true
additionalProperties: {}
additionalProperties: { }
WeatherForecast:
type: object
properties:
Expand Down

0 comments on commit b814c43

Please sign in to comment.