protected Object filterModel(Map<String, Object> model) {
        int expectSize = model.size();
        final Set<String> renderedKeys;
        if (CollectionUtils.isEmpty(this.renderedAttributes)) {
            renderedKeys = null;
        } else {
            renderedKeys = this.renderedAttributes;
            expectSize = renderedKeys.size();
        }
        // This is a high frequency operation and is worth optimizing separately.
        if (expectSize == 1 && extractValueFromSingleKeyModel) {
            Object value = renderedKeys != null
                    ? model.get(renderedKeys.iterator().next())
                    : model.values().iterator().next();
            return value instanceof BindingResult ? Collections.emptyMap() : value;
        }

        final Map<String, Object> result = new HashMap<>(expectSize, 1F);
        for (Map.Entry<String, Object> entry : model.entrySet()) {
            if (!(entry.getValue() instanceof BindingResult)
                    && (renderedKeys == null || renderedKeys.contains(entry.getKey()))) {
                result.put(entry.getKey(), entry.getValue());
            }
        }
        if (extractValueFromSingleKeyModel && result.size() == 1) {
            for (Map.Entry<String, Object> entry : result.entrySet()) {
                return entry.getValue();
            }
        }
        return result;
    }
Filters out undesired attributes from the given model. The return value
can be either another {@link Map}, or a single value object.
<p>
Default implementation removes {@link BindingResult} instances and
entries not included in the {@link #setRenderedAttributes(Set)
renderedAttributes} property.

@param model the model, as passed on to {@link #renderMergedOutputModel}
@return the object to be rendered
extension-spring5/src/main/java/com/alibaba/fastjson2/support/spring/webservlet/view/FastJsonJsonView.java