Class CustomModelResolver

  • All Implemented Interfaces:
    io.swagger.v3.core.converter.ModelConverter

    @Component
    public class CustomModelResolver
    extends io.swagger.v3.core.jackson.ModelResolver
    Resolve Arg parameters' schema. This should always be added last with ModelConverters.addConverter(ModelConverter) to take priority as it addresses a glitch in the original ModelResolver.
    Author:
    poirigui
    • Field Summary

      • Fields inherited from class io.swagger.v3.core.jackson.ModelResolver

        composedModelPropertiesAsSibling, enumsAsRef, NOT_NULL_ANNOTATIONS, SET_PROPERTY_OF_COMPOSED_MODEL_AS_SIBLING, SET_PROPERTY_OF_ENUMS_AS_REF
      • Fields inherited from class io.swagger.v3.core.jackson.AbstractModelConverter

        _intr, _mapper, _resolvedTypeNames, _typeNameResolver
    • Constructor Summary

      Constructors 
      Constructor Description
      CustomModelResolver​(com.fasterxml.jackson.databind.ObjectMapper objectMapper, ubic.gemma.core.search.SearchService searchService)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      io.swagger.v3.oas.models.media.Schema resolve​(io.swagger.v3.core.converter.AnnotatedType type, io.swagger.v3.core.converter.ModelConverterContext context, Iterator<io.swagger.v3.core.converter.ModelConverter> chain)  
      protected List<String> resolveAllowableValues​(com.fasterxml.jackson.databind.introspect.Annotated a, Annotation[] annotations, io.swagger.v3.oas.annotations.media.Schema schema)
      protected String resolveDescription​(com.fasterxml.jackson.databind.introspect.Annotated a, Annotation[] annotations, io.swagger.v3.oas.annotations.media.Schema schema)  
      protected Map<String,​Object> resolveExtensions​(com.fasterxml.jackson.databind.introspect.Annotated a, Annotation[] annotations, io.swagger.v3.oas.annotations.media.Schema schema)  
      • Methods inherited from class io.swagger.v3.core.jackson.ModelResolver

        _addEnumProps, _isOptionalType, addRequiredItem, applyBeanValidatorAnnotations, applyBeanValidatorAnnotations, decorateModelName, findJsonValueType, getComposedSchemaReferencedClasses, hasHiddenAnnotation, hiddenByJsonView, ignore, ignore, objectMapper, resolveAccessMode, resolveDefaultValue, resolveDeprecated, resolveDiscriminator, resolveDiscriminatorProperty, resolveExample, resolveExclusiveMaximum, resolveExclusiveMinimum, resolveExtensions, resolveExternalDocumentation, resolveExternalDocumentation, resolveFormat, resolveIgnoredProperties, resolveIgnoredProperties, resolveMaximum, resolveMaxItems, resolveMaxLength, resolveMaxProperties, resolveMinimum, resolveMinItems, resolveMinLength, resolveMinProperties, resolveMultipleOf, resolveNullable, resolvePattern, resolvePatternProperties, resolveReadOnly, resolveRequiredMode, resolveRequiredProperties, resolveSchemaMembers, resolveSchemaMembers, resolveSchemaProperties, resolveTitle, resolveUniqueItems, resolveWrapping, resolveWriteOnly, resolveXml, shouldIgnoreClass
      • Methods inherited from class io.swagger.v3.core.jackson.AbstractModelConverter

        _findTypeName, _isSetType, _subTypeName, _typeName, _typeName, _typeQName
    • Constructor Detail

      • CustomModelResolver

        @Autowired
        public CustomModelResolver​(@Qualifier("swaggerObjectMapper")
                                   com.fasterxml.jackson.databind.ObjectMapper objectMapper,
                                   ubic.gemma.core.search.SearchService searchService)
    • Method Detail

      • resolve

        public io.swagger.v3.oas.models.media.Schema resolve​(io.swagger.v3.core.converter.AnnotatedType type,
                                                             io.swagger.v3.core.converter.ModelConverterContext context,
                                                             Iterator<io.swagger.v3.core.converter.ModelConverter> chain)
        Specified by:
        resolve in interface io.swagger.v3.core.converter.ModelConverter
        Overrides:
        resolve in class io.swagger.v3.core.jackson.ModelResolver
      • resolveAllowableValues

        protected List<String> resolveAllowableValues​(com.fasterxml.jackson.databind.introspect.Annotated a,
                                                      Annotation[] annotations,
                                                      io.swagger.v3.oas.annotations.media.Schema schema)
        Resolves allowed values for the SearchWebService.search(String, TaxonArg, PlatformArg, List, LimitArg, ExcludeArg) resultTypes argument.

        This ensures that the OpenAPI specification exposes all supported search result types in the SearchService as allowable values.

        Overrides:
        resolveAllowableValues in class io.swagger.v3.core.jackson.ModelResolver
      • resolveDescription

        protected String resolveDescription​(com.fasterxml.jackson.databind.introspect.Annotated a,
                                            Annotation[] annotations,
                                            io.swagger.v3.oas.annotations.media.Schema schema)
        Overrides:
        resolveDescription in class io.swagger.v3.core.jackson.ModelResolver
      • resolveExtensions

        protected Map<String,​Object> resolveExtensions​(com.fasterxml.jackson.databind.introspect.Annotated a,
                                                             Annotation[] annotations,
                                                             io.swagger.v3.oas.annotations.media.Schema schema)
        Overrides:
        resolveExtensions in class io.swagger.v3.core.jackson.ModelResolver