public void PostConfigure(string name, MvcOptions options) { if (_coreFeatures.SupportsBatch) { // Turns on batch, even when not configured in the DefaultCapabilities.json // If this is not enabled in the capability statement // PostBundleRequest for Batch will fail with a MethodNotAllowedException _configuredConformanceProvider .ConfigureOptionalCapabilities(x => { x.Rest.First().Interaction.Add(new CapabilityStatement.SystemInteractionComponent { Code = SystemRestfulInteraction.Batch, }); }); } // _supportTransaction flag should always be turned off if CosmosDb is choosen as a persistence layer. if (_coreFeatures.SupportsTransaction) { // Turns on transaction, even when not configured in the DefaultCapabilities.json // If this is not enabled in the capability statement // PostBundleRequest for Transaction will fail with a MethodNotAllowedException _configuredConformanceProvider .ConfigureOptionalCapabilities(x => { x.Rest.First().Interaction.Add(new CapabilityStatement.SystemInteractionComponent { Code = SystemRestfulInteraction.Transaction, }); }); } }
public void PostConfigure(string name, MvcOptions options) { for (int i = 0; i < _inputFormatters.Length; i++) { options.InputFormatters.Insert(i, _inputFormatters[i]); } for (int i = 0; i < _outputFormatters.Length; i++) { options.OutputFormatters.Insert(i, _outputFormatters[i]); } if (_featureConfiguration.SupportsXml) { // TODO: This feature flag should be removed when we support custom capability statements _configuredConformanceProvider.ConfigureOptionalCapabilities(statement => statement.Format = statement.Format.Concat(new[] { KnownContentTypes.XmlContentType })); } // Disable the built-in global UnsupportedContentTypeFilter // We enable our own ValidateContentTypeFilterAttribute on the FhirController, the built-in filter // short-circuits the response and prevents the operation outcome from being returned. var unsupportedContentTypeFilter = options.Filters.Single(x => x is UnsupportedContentTypeFilter); options.Filters.Remove(unsupportedContentTypeFilter); }
public void PostConfigure(string name, MvcOptions options) { _configuredConformanceProvider .ConfigureOptionalCapabilities(x => { if (_modelInfoProvider.Version.Equals(FhirSpecification.Stu3)) { x.Rest.Server().Operation.Add(new OperationComponent() { Name = OperationTypes.Validate, Definition = new ReferenceComponent() { Reference = OperationTypes.ValidateUri, }, }); } else { x.Rest.Server().Operation.Add(new OperationComponent() { Name = OperationTypes.Validate, Definition = OperationTypes.ValidateUri, }); } }); }
public void PostConfigure(string name, MvcOptions options) { if (_featureConfiguration.SupportsXml) { _configuredConformanceProvider.ConfigureOptionalCapabilities(statement => statement.Format = statement.Format.Concat(new[] { KnownContentTypes.XmlContentType })); } }
public void PostConfigure(string name, MvcOptions options) { _configuredConformanceProvider .ConfigureOptionalCapabilities(x => { x.Rest.Server().Operation.Add(new OperationComponent { Name = OperationTypes.Validate, Definition = new ReferenceComponent { Reference = OperationTypes.ValidateUri, }, }); }); }
public void PostConfigure(string name, MvcOptions options) { if (_features.SupportsConditionalCreate) { // Turns on conditional creates, even when not configured in the DefaultCapabilities.json // If this is not enabled in the capability statement // ConditionalCreateResourceRequest will fail with a MethodNotAllowedException _configuredConformanceProvider .ConfigureOptionalCapabilities(x => { foreach (var r in x.Rest.First().Resource) { r.ConditionalCreate = true; } }); } }
public void PostConfigure(string name, MvcOptions options) { if (_features.SupportsConditionalCreate) { // Turns on conditional creates, even when not configured in the DefaultCapabilities.json // If this is not enabled in the capability statement // ConditionalCreateResourceRequest will fail with a MethodNotAllowedException _configuredConformanceProvider .ConfigureOptionalCapabilities(x => { foreach (ListedResourceComponent r in x.Rest.Server().Resource) { if (r.Interaction.Any(y => string.Equals(y.Code, TypeRestfulInteraction.Create, StringComparison.Ordinal))) { r.ConditionalCreate = true; } } }); } }