Skip to content

Conversation

@XeNz
Copy link

@XeNz XeNz commented Dec 18, 2019

…l helper + remove mvcoption references which are now removed in 3.0

…l helper + remove mvcoption references which are now removed in 3.0

if (!apiOptions.DisableVersioning)
{
builder.AddMvcOptions(options =>
Copy link
Author

Choose a reason for hiding this comment

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

this does not work in 3.0

namespace Digipolis.Web.Swagger
{
// This filter is necessary to correct the $Ref in the swagger for response types that are generic types.
public class ValidRefUri : IOperationFilter
Copy link
Author

Choose a reason for hiding this comment

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

Not sure if this is still needed with new swashbuckle version

[HttpGet()]
[ProducesResponseType(typeof(PagedResult<ValueDto>), 200)]
[AllowAnonymous]
[Versions(Versions.V1, Versions.V2)]
Copy link
Author

@XeNz XeNz Dec 18, 2019

Choose a reason for hiding this comment

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

versioning is currently probably broken

{
// Add framework services.
services.AddMvc()
.AddNewtonsoftJson(options => options.SerializerSettings.Initialize()) // set default Digipolis json serializer settings
Copy link
Author

Choose a reason for hiding this comment

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

Thisi s a workaround for not being able to use MvcOptions anymore.
Making the initialize public, also lets the consumer hook on the JsonSerializerSettings with an action.

settings.NullValueHandling = NullValueHandling.Ignore;
settings.Converters.Add(new TimeSpanConverter());
settings.Converters.Add(new GuidConverter());
settings.Converters.Add(new StringEnumConverter());
Copy link
Author

Choose a reason for hiding this comment

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

Swashbuckle now adheres at the general JsonSerializerSettings.
DescribeEnumsAsString for SwaggerOptions is deprecated now.

{
if (bindingContext.ModelMetadata.IsEnumerableType)
{
if (bindingContext == null)
Copy link
Author

Choose a reason for hiding this comment

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

always false

{
protected override void Configuration(SwaggerGenOptions options)
{
options.DescribeAllEnumsAsStrings();
Copy link
Author

Choose a reason for hiding this comment

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

deprecated


namespace Digipolis.Web.UnitTests.Startup
{
public class MvcBuilderExtensionsTests
Copy link
Author

Choose a reason for hiding this comment

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

Probably needs to be deleted unless we can fix the MvcOptions problem

@XeNz XeNz mentioned this pull request Dec 18, 2019
@XeNz XeNz changed the title Upped all dependencies + fixed most swagger related issues + fixed ur… .net core 3.1 upgrade Dec 19, 2019
@indy-dewacker
Copy link

What's the status of this PR?

@Jonah-Jordan
Copy link

Status?

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.

3 participants