There is a problem with _raw.flattenedPath in generated JSON schemas for content files.
If there is a file with "index" in the end of filename then this part will be erased in resulted value of _raw.flattenedPath
For example:
- “search-by-index.mdx” will be resulted into “search-by-” in generated JSON schema;
- “find-element-by-index.md” will be resulted into “find-element-by-“
- “solution-documents/search-by-index.mdx” will be resulted into “solution-documents/search-by-“
- “solution-documents/find-element-by-index.md” will be resulted into “solution-documents/find-element-by-”

Here is a repo to reproduce the issue: https://github.com/Oleksandr-Kei/contentlayer-project
Actual problem could be in this line
Because /\/?index$/ covers not only cases of "something/index" and "index". But also cases like "something-index", "somethingindex", etc.
There is a problem with
_raw.flattenedPathin generated JSON schemas for content files.If there is a file with "index" in the end of filename then this part will be erased in resulted value of
_raw.flattenedPathFor example:
Here is a repo to reproduce the issue: https://github.com/Oleksandr-Kei/contentlayer-project
Actual problem could be in this line
Because
/\/?index$/covers not only cases of "something/index" and "index". But also cases like "something-index", "somethingindex", etc.