Include only APIs that match the hasAttribute property in filter. Exclude all the rest of APIs
- Dominant language
- C#
- Stars
- 4.4k
- Forks
- 890
- Avg merge
- 2h 11m
- Merged PRs (30d)
- 10
Description
**Operating System**: `Windows`
**DocFX Version Used**: `2.59.3.0`
**Template used**: `default`
**Steps to Reproduce**:
1. Initiate docfx in code using `docfx init -q --apiGlobPattern spec/**.csproj --apiSourceFolder .. -o unitTests`
2. Change directory to unitTests and generate metadata using `docfx metadata --filter filter-config.yml`
**docfx.json**:
`{
"metadata": [
{
"src": [
{
"files": [
"spec/**.csproj"
],
"src": ".."
}
],
"dest": "api",
"disableGitFeatures": false,
"disableDefaultFilter": false
}
],
"build": {
"content": [
{
"files": [
"api/**.yml",
"api/index.md"
]
},
{
"files": [
"articles/**.md",
"articles/**/toc.yml",
"toc.yml",
"*.md"
]
}
],
"resource": [
{
"files": [
"images/**"
]
}
],
"overwrite": [
{
"files": [
"apidoc/**.md"
],
"exclude": [
"obj/**",
"_site/**"
]
}
],
"dest": "_site",
"globalMetadataFiles": [],
"fileMetadataFiles": [],
"template": [
"default"
],
"postProcessors": [],
"markdownEngineName": "markdig",
"noLangKeyword": false,
"keepFileLink": false,
"cleanupCacheHistory": false,
"disableGitFeatures": false
}
}`
**filter-config.yml**:

**Expected Behavior**:
It should only include the APIs which have an Attribute of Xunit.FactAttribute or Xunit.TheoryAttribute and remove the rest.
**Actual Behavior**:
It generates metadata for all the APIs "including" Fact and Theory Attribute, but not excluding the rest.
When replacing the `include` with `exclude`, it does what it's supposed to do, and removes all APIs with Fact or Theory attribute.
I've also tried putting this at the end of the includes but it doesn't work..
`-exclude:
uidRegex: .*
`
This just removes everything..
Contributor guide
Assessment
This issue has not been assessed yet.