Example #1
0
 public ResponseTypeGenerator(ILocatedOpenApiElement <OpenApiResponse> responseElement, GenerationContext context,
                              IMediaTypeSelector mediaTypeSelector,
                              IHttpResponseCodeNameProvider httpResponseCodeNameProvider,
                              ISerializationNamespace serializationNamespace,
                              IResponsesNamespace responsesNamespace,
                              IGetBodyMethodGenerator getBodyMethodGenerator)
     : base(responseElement, context)
 {
     MediaTypeSelector            = mediaTypeSelector ?? throw new ArgumentNullException(nameof(mediaTypeSelector));
     HttpResponseCodeNameProvider = httpResponseCodeNameProvider ??
                                    throw new ArgumentNullException(nameof(httpResponseCodeNameProvider));
     SerializationNamespace = serializationNamespace ?? throw new ArgumentNullException(nameof(serializationNamespace));
     ResponsesNamespace     = responsesNamespace ?? throw new ArgumentNullException(nameof(responsesNamespace));
     GetBodyMethodGenerator = getBodyMethodGenerator ?? throw new ArgumentNullException(nameof(getBodyMethodGenerator));
 }
 public ResponseTypeGeneratorFactory(GenerationContext context, IMediaTypeSelector mediaTypeSelector,
                                     IHttpResponseCodeNameProvider httpResponseCodeNameProvider,
                                     IResponsesNamespace responsesNamespace, IGetBodyMethodGenerator parseBodyMethodGenerator,
                                     ISerializationNamespace serializationNamespace)
 {
     _context                      = context ?? throw new ArgumentNullException(nameof(context));
     _mediaTypeSelector            = mediaTypeSelector ?? throw new ArgumentNullException(nameof(mediaTypeSelector));
     _httpResponseCodeNameProvider = httpResponseCodeNameProvider ??
                                     throw new ArgumentNullException(nameof(httpResponseCodeNameProvider));
     _responsesNamespace = responsesNamespace ??
                           throw new ArgumentNullException(nameof(responsesNamespace));
     _parseBodyMethodGenerator = parseBodyMethodGenerator ??
                                 throw new ArgumentNullException(nameof(parseBodyMethodGenerator));
     _serializationNamespace = serializationNamespace ??
                               throw new ArgumentNullException(nameof(serializationNamespace));
 }