Swagger hide property java This is useful, for example, when GET returns more properties than used in POST – you can use the same schema in both GET and POST and mark the extra properties as readOnly. oas. package1, com. Default: "" Jan 8, 2024 · It’s useful to hide a property only from Swagger for example, when we have a new API version that doesn’t need a property anymore, but we want to keep our schema backward compatible. defaultModelsExpandDepth=-1 in application. My problem is the following: Swagger-ui is providing an example of a JSON for one of the GET endpoints. models. class HideOrganizationUnitsFilter : IDocumentFilter { private const string pathToHide = "/identity/organization-units"; public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context) { var organizationUnitPaths = swaggerDoc . We need this annotation, however, to tell Jackson to use it only for de-serialization. Contains(pathToHide, StringComparison Mar 26, 2025 · Alternatively, we can use @ApiOperation to hide a single endpoint: @ApiOperation(value = "This method is used to get the current date. prhi zgsxr nlf czit wjrl idczi olk pjvt pngbp gukzds