Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Добавление возможности писать модели в отдельных файлах #12

Merged
merged 5 commits into from
Apr 3, 2021

Conversation

acherkashin
Copy link
Owner

This issue closes #11

@AlexSnowLeo
Copy link
Collaborator

Надо попробовать устранить ошибку при парсинге файла в редакторе:
Unexpected error when trying to process file:///d%3A/Work/GitHub/acherkashin/yandex-music-open-api/src/yandex-music.yaml: TypeError: Cannot read property 'indirections' of null

И нет возможности теперь перейти на файл по Ctlr-Click. А в таком варианте работало:
$ref: './models/InvocationInfo.yaml'

Copy link
Collaborator

@AlexSnowLeo AlexSnowLeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Смотри комментарий

@acherkashin
Copy link
Owner Author

Нужно настроить path-loader чтобы он понимал относительные пути
https://github.com/whitlockjc/json-refs/blob/master/docs/API.md#module_json-refs.JsonRefsOptions

@acherkashin
Copy link
Owner Author

@AlexSnowLeo Проблема была в том, что лоадер был асинхронный поэтому он попросту игнорировался. Я сделал его синхронным и добавил location в конфигурацию, чтобы парсер понимал относительные пути, теперь ошибки в редакторе нет и всё работает. В будущем нужно проверить ApiDevTools/json-schema-ref-parser возможно он нам подойдет больше.

@acherkashin acherkashin merged commit 73ad2fe into main Apr 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Перенести модели в отдельные файлы
2 participants