Skip to content

When removing #3

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

Open
srpeirce opened this issue Sep 12, 2019 · 1 comment
Open

When removing #3

srpeirce opened this issue Sep 12, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@srpeirce
Copy link
Contributor

Incorrectly showing V1 in Swagger when explicitly removed from a verson, and changing the start version.

e.g. only v2 and v3 should be accessable

            services.AddApiVersioning(options =>
            {
                options.Conventions = new IntroducedApiVersionConventionBuilder(2, 3);
                options.ReportApiVersions = true;
            });
            services.AddVersionedApiExplorer(
                options =>
                {
                    options.GroupNameFormat = "'v'VVV";
                    options.SubstituteApiVersionInUrl = true;
                });

But this is showing as V1 still

    [ApiController]
    [Route("api/v{api-version:apiVersion}/events/{eventId}/media")]
    [IntroducedInApiVersion(1)]
    [RemovedAsOfApiVersion(2)]
    [ResponseCache(CacheProfileName = CacheProfileNames.None)]
    public class MediaController : Controller
    {
        private readonly IMediaService _mediaService;

        public MediaController(IMediaService mediaService)
        {
            _mediaService = mediaService;
        }

        [HttpGet]
        public async Task<ActionResult<MediaV1[]>> Get(string eventId)
        {
            var media = (await _mediaService.GetForEventAsync(eventId))
                .Select(m => MediaV1.MapFrom(m, true, false))
                .ToArray();

            return media;
        }
    }
@srpeirce srpeirce added the bug Something isn't working label Sep 12, 2019
@srpeirce
Copy link
Contributor Author

Note: I can just remove this as I have removed V1 so not strictly a problem - I just would not expect it to show.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant