{"id":13779,"date":"2024-03-15T07:51:33","date_gmt":"2024-03-15T07:51:33","guid":{"rendered":"https:\/\/www.silicloud.com\/blog\/how-to-resolve-swaggers-apimodelproperty-failing-to-work\/"},"modified":"2025-08-05T23:21:05","modified_gmt":"2025-08-05T23:21:05","slug":"how-to-resolve-swaggers-apimodelproperty-failing-to-work","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/blog\/how-to-resolve-swaggers-apimodelproperty-failing-to-work\/","title":{"rendered":"Fix Swagger ApiModelProperty Hidden Issue"},"content":{"rendered":"<p>In the @ApiModelProperty annotation in Swagger, you can specify the hidden attribute to control whether to hide the field. If the hidden attribute is set to true, the field will not be displayed in the Swagger UI.<\/p>\n<p>If the &#8220;hidden&#8221; attribute in the @ApiModelProperty annotation in Swagger is set to false or not set, but the field still cannot be displayed, it may be due to the following reasons:<\/p>\n<ol>\n<li>The Swagger dependencies are not properly imported. Make sure that you have correctly imported the Swagger dependencies. For example, for a Spring Boot project, you can import Swagger by adding the following dependencies:<\/li>\n<li><dependency><br \/>\n    <groupId>io.springfox<\/groupId><br \/>\n    <artifactId>springfox-swagger2<\/artifactId><br \/>\n    <version>${springfox.version}<\/version><br \/>\n<\/dependency><br \/>\n<dependency><br \/>\n    <groupId>io.springfox<\/groupId><br \/>\n    <artifactId>springfox-swagger-ui<\/artifactId><br \/>\n    <version>${springfox.version}<\/version><br \/>\n<\/dependency><\/li>\n<li>The Docket object in the Swagger configuration is not properly set up. Make sure the Docket object in the Swagger configuration class is correctly configured and includes the API package path that needs to be scanned. For example, here is a simple Swagger configuration class example:<\/li>\n<li>This block of code is setting up Swagger configuration in a Spring Boot application by enabling Swagger2 and defining a Docket bean which specifies where to look for API endpoints.<\/li>\n<li>The @ApiModelProperty annotation on the entity class is not being used correctly. Please make sure that the @ApiModelProperty annotation is properly applied to the fields of the entity class and the correct properties are specified. For example, the following is an example of using the @ApiModelProperty annotation:<\/li>\n<li>\n@ApiModel(description = &#8220;Entity class for users&#8221;)<br \/>\npublic class User {<\/p>\n<p>    @ApiModelProperty(value = &#8220;User ID&#8221;, example = &#8220;1&#8221;)<br \/>\n    private Integer id;<\/p>\n<p>    @ApiModelProperty(value = &#8220;Username&#8221;, example = &#8220;John&#8221;)<br \/>\n    private String username;<\/p>\n<p>    \/\/ getters and setters<br \/>\n}<\/li>\n<\/ol>\n<p>If none of the above solutions work, we suggest checking the compatibility of Swagger version and referring to Swagger documentation or community for related discussions and solutions.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the @ApiModelProperty annotation in Swagger, you can specify the hidden attribute to control whether to hide the field. If the hidden attribute is set to true, the field will not be displayed in the Swagger UI. If the &#8220;hidden&#8221; attribute in the @ApiModelProperty annotation in Swagger is set to false or not set, but [&hellip;]<\/p>\n","protected":false},"author":14,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","footnotes":""},"categories":[1],"tags":[3423,18437,18472,2722,18473],"class_list":["post-13779","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-api-documentation","tag-apimodelproperty","tag-hidden-attribute","tag-swagger","tag-swagger-ui"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Fix Swagger ApiModelProperty Hidden Issue - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"Resolve @ApiModelProperty hidden attribute problems in Swagger UI. Fix hidden fields not displaying correctly.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/blog\/how-to-resolve-swaggers-apimodelproperty-failing-to-work\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Fix Swagger ApiModelProperty Hidden Issue\" \/>\n<meta property=\"og:description\" content=\"Resolve @ApiModelProperty hidden attribute problems in Swagger UI. Fix hidden fields not displaying correctly.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/blog\/how-to-resolve-swaggers-apimodelproperty-failing-to-work\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/SiliCloudGlobal\/\" \/>\n<meta property=\"article:published_time\" content=\"2024-03-15T07:51:33+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-05T23:21:05+00:00\" \/>\n<meta name=\"author\" content=\"Noah Thompson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@SiliCloudGlobal\" \/>\n<meta name=\"twitter:site\" content=\"@SiliCloudGlobal\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Noah Thompson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/how-to-resolve-swaggers-apimodelproperty-failing-to-work\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/how-to-resolve-swaggers-apimodelproperty-failing-to-work\/\"},\"author\":{\"name\":\"Noah Thompson\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/2e83cc6ab9f60d36921c2d0f9f280f4a\"},\"headline\":\"Fix Swagger ApiModelProperty Hidden Issue\",\"datePublished\":\"2024-03-15T07:51:33+00:00\",\"dateModified\":\"2025-08-05T23:21:05+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/how-to-resolve-swaggers-apimodelproperty-failing-to-work\/\"},\"wordCount\":295,\"publisher\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/#organization\"},\"keywords\":[\"API Documentation\",\"ApiModelProperty\",\"hidden attribute\",\"Swagger\",\"Swagger UI\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/how-to-resolve-swaggers-apimodelproperty-failing-to-work\/\",\"url\":\"https:\/\/www.silicloud.com\/blog\/how-to-resolve-swaggers-apimodelproperty-failing-to-work\/\",\"name\":\"Fix Swagger ApiModelProperty Hidden Issue - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/#website\"},\"datePublished\":\"2024-03-15T07:51:33+00:00\",\"dateModified\":\"2025-08-05T23:21:05+00:00\",\"description\":\"Resolve @ApiModelProperty hidden attribute problems in Swagger UI. Fix hidden fields not displaying correctly.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/how-to-resolve-swaggers-apimodelproperty-failing-to-work\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/blog\/how-to-resolve-swaggers-apimodelproperty-failing-to-work\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/how-to-resolve-swaggers-apimodelproperty-failing-to-work\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.silicloud.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Fix Swagger ApiModelProperty Hidden Issue\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/blog\/\",\"name\":\"Silicon Cloud Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/#organization\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#organization\",\"name\":\"Silicon Cloud Blog\",\"url\":\"https:\/\/www.silicloud.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.silicloud.com\/blog\/wp-content\/uploads\/2023\/11\/EN-SILICON-Full.png\",\"contentUrl\":\"https:\/\/www.silicloud.com\/blog\/wp-content\/uploads\/2023\/11\/EN-SILICON-Full.png\",\"width\":1024,\"height\":1024,\"caption\":\"Silicon Cloud Blog\"},\"image\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/SiliCloudGlobal\/\",\"https:\/\/twitter.com\/SiliCloudGlobal\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/2e83cc6ab9f60d36921c2d0f9f280f4a\",\"name\":\"Noah Thompson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/350e537e1530ede2762ee0237e877d6693f4f7163ab4f303202cc9a6b27b6cb4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/350e537e1530ede2762ee0237e877d6693f4f7163ab4f303202cc9a6b27b6cb4?s=96&d=mm&r=g\",\"caption\":\"Noah Thompson\"},\"url\":\"https:\/\/www.silicloud.com\/blog\/author\/noahthompson\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Fix Swagger ApiModelProperty Hidden Issue - Blog - Silicon Cloud","description":"Resolve @ApiModelProperty hidden attribute problems in Swagger UI. Fix hidden fields not displaying correctly.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/blog\/how-to-resolve-swaggers-apimodelproperty-failing-to-work\/","og_locale":"en_US","og_type":"article","og_title":"Fix Swagger ApiModelProperty Hidden Issue","og_description":"Resolve @ApiModelProperty hidden attribute problems in Swagger UI. Fix hidden fields not displaying correctly.","og_url":"https:\/\/www.silicloud.com\/blog\/how-to-resolve-swaggers-apimodelproperty-failing-to-work\/","og_site_name":"Blog - Silicon Cloud","article_publisher":"https:\/\/www.facebook.com\/SiliCloudGlobal\/","article_published_time":"2024-03-15T07:51:33+00:00","article_modified_time":"2025-08-05T23:21:05+00:00","author":"Noah Thompson","twitter_card":"summary_large_image","twitter_creator":"@SiliCloudGlobal","twitter_site":"@SiliCloudGlobal","twitter_misc":{"Written by":"Noah Thompson","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.silicloud.com\/blog\/how-to-resolve-swaggers-apimodelproperty-failing-to-work\/#article","isPartOf":{"@id":"https:\/\/www.silicloud.com\/blog\/how-to-resolve-swaggers-apimodelproperty-failing-to-work\/"},"author":{"name":"Noah Thompson","@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/2e83cc6ab9f60d36921c2d0f9f280f4a"},"headline":"Fix Swagger ApiModelProperty Hidden Issue","datePublished":"2024-03-15T07:51:33+00:00","dateModified":"2025-08-05T23:21:05+00:00","mainEntityOfPage":{"@id":"https:\/\/www.silicloud.com\/blog\/how-to-resolve-swaggers-apimodelproperty-failing-to-work\/"},"wordCount":295,"publisher":{"@id":"https:\/\/www.silicloud.com\/blog\/#organization"},"keywords":["API Documentation","ApiModelProperty","hidden attribute","Swagger","Swagger UI"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/blog\/how-to-resolve-swaggers-apimodelproperty-failing-to-work\/","url":"https:\/\/www.silicloud.com\/blog\/how-to-resolve-swaggers-apimodelproperty-failing-to-work\/","name":"Fix Swagger ApiModelProperty Hidden Issue - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/blog\/#website"},"datePublished":"2024-03-15T07:51:33+00:00","dateModified":"2025-08-05T23:21:05+00:00","description":"Resolve @ApiModelProperty hidden attribute problems in Swagger UI. Fix hidden fields not displaying correctly.","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/blog\/how-to-resolve-swaggers-apimodelproperty-failing-to-work\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/blog\/how-to-resolve-swaggers-apimodelproperty-failing-to-work\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/blog\/how-to-resolve-swaggers-apimodelproperty-failing-to-work\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.silicloud.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Fix Swagger ApiModelProperty Hidden Issue"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/blog\/#website","url":"https:\/\/www.silicloud.com\/blog\/","name":"Silicon Cloud Blog","description":"","publisher":{"@id":"https:\/\/www.silicloud.com\/blog\/#organization"},"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.silicloud.com\/blog\/#organization","name":"Silicon Cloud Blog","url":"https:\/\/www.silicloud.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.silicloud.com\/blog\/wp-content\/uploads\/2023\/11\/EN-SILICON-Full.png","contentUrl":"https:\/\/www.silicloud.com\/blog\/wp-content\/uploads\/2023\/11\/EN-SILICON-Full.png","width":1024,"height":1024,"caption":"Silicon Cloud Blog"},"image":{"@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/SiliCloudGlobal\/","https:\/\/twitter.com\/SiliCloudGlobal"]},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/2e83cc6ab9f60d36921c2d0f9f280f4a","name":"Noah Thompson","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/350e537e1530ede2762ee0237e877d6693f4f7163ab4f303202cc9a6b27b6cb4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/350e537e1530ede2762ee0237e877d6693f4f7163ab4f303202cc9a6b27b6cb4?s=96&d=mm&r=g","caption":"Noah Thompson"},"url":"https:\/\/www.silicloud.com\/blog\/author\/noahthompson\/"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/posts\/13779","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/users\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/comments?post=13779"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/posts\/13779\/revisions"}],"predecessor-version":[{"id":157786,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/posts\/13779\/revisions\/157786"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/media?parent=13779"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/categories?post=13779"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/tags?post=13779"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}