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

Async-all-the-way: Consider making IOperationProcessor and IDocumentProcessor Async #684

Closed
dgioulakis opened this issue Mar 17, 2017 · 1 comment

Comments

@dgioulakis
Copy link
Contributor

This would be a breaking change but one easy to change and update existing processors.

The pipeline is already async-ready:

public async Task<SwaggerDocument> GenerateForControllersAsync(IEnumerable<Type> controllerTypes)
        {
            var document = await CreateDocumentAsync(Settings).ConfigureAwait(false);
            var schemaResolver = new SwaggerSchemaResolver(document, Settings);

            foreach (var controllerType in controllerTypes)
                await GenerateForControllerAsync(document, controllerType, new SwaggerGenerator(_schemaGenerator, Settings, schemaResolver)).ConfigureAwait(false);

            document.GenerateOperationIds();

            foreach (var processor in Settings.DocumentProcessors)
                processor.Process(new DocumentProcessorContext(document, controllerTypes, schemaResolver, _schemaGenerator));

            return document;
        }
@RicoSuter
Copy link
Owner

We should definitely do that. The question is whether to break or support backward comp. (ie two interfaces, processors as list of object).

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

No branches or pull requests

2 participants