Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Remove unused swagger definitions #1805

Closed
MaciejBaj opened this issue Apr 3, 2018 · 7 comments
Closed

Remove unused swagger definitions #1805

MaciejBaj opened this issue Apr 3, 2018 · 7 comments

Comments

@MaciejBaj
Copy link
Contributor

Expected behavior

Unused definitions are removed.

Actual behavior

Every time node start the warning is being shown:

WARNING: NODE_ENV value of 'test' did not match any deployment config file names.
WARNING: See https://github.com/lorenwest/node-config/wiki/Strict-Mode
WARNING: NODE_APP_INSTANCE value of '0' did not match any instance config file names.
WARNING: See https://github.com/lorenwest/node-config/wiki/Strict-Mode
[{"code":"UNUSED_DEFINITION","message":"Definition is not used: #/definitions/CommonBlock","path":["definitions","CommonBlock"]},{"code":"UNUSED_DEFINITION","message":"Definition is not used: #/definitions/PeersList","path":["definitions","PeersList"]},{"code":"UNUSED_DEFINITION","message":"Definition is not used: #/definitions/WSPeerHeaders","path":["definitions","WSPeerHeaders"]},{"code":"UNUSED_DEFINITION","message":"Definition is not used: #/definitions/WSPeerUpdateRequest","path":["definitions","WSPeerUpdateRequest"]},{"code":"UNUSED_DEFINITION","message":"Definition is not used: #/definitions/WSSignaturesList","path":["definitions","WSSignaturesList"]},{"code":"UNUSED_DEFINITION","message":"Definition is not used: #/definitions/WSBlocksList","path":["definitions","WSBlocksList"]},{"code":"UNUSED_DEFINITION","message":"Definition is not used: #/definitions/WSBlocksCommonRequest","path":["definitions","WSBlocksCommonRequest"]},{"code":"UNUSED_DEFINITION","message":"Definition is not used: #/definitions/WSTransactionsRequest","path":["definitions","WSTransactionsRequest"]},{"code":"UNUSED_DEFINITION","message":"Definition is not used: #/definitions/WSAccessObject","path":["definitions","WSAccessObject"]},{"code":"UNUSED_DEFINITION","message":"Definition is not used: #/definitions/WSTransactionsResponse","path":["definitions","WSTransactionsResponse"]},{"code":"UNUSED_DEFINITION","message":"Definition is not used: #/definitions/WSSignaturesResponse","path":["definitions","WSSignaturesResponse"]},{"code":"UNUSED_DEFINITION","message":"Definition is not used: #/definitions/WSBlocksBroadcast","path":["definitions","WSBlocksBroadcast"]}] 2

Steps to reproduce

Start lisk-core.

Which version(s) does this affect? (Environment, OS, etc...)

1.0.0

@MaciejBaj MaciejBaj added this to the Version 1.0.0-alpha.5 milestone Apr 3, 2018
@nazarhussain
Copy link
Contributor

@MaciejBaj These definitions are used in our application but not in the HTTP API endpoints. Keep them for now, later we will refactor the swagger definition to decompose it to individual definition file then this warning will automatically be removed.

@MaciejBaj
Copy link
Contributor Author

It still looks bad in logs. It will be solved as introduced in 1.0.0 release.

@Tschakki Tschakki added *hard and removed *easy labels Apr 12, 2018
@MaciejBaj MaciejBaj added the api label Jun 19, 2018
@MaciejBaj MaciejBaj added this to the Version 1.1.0 milestone Jun 20, 2018
@nazarhussain
Copy link
Contributor

nazarhussain commented Jun 29, 2018

This issue is caused due to

https://github.com/theganyo/swagger-node-runner/blob/3f5c099161ed7f526338091612463d5fc3c91880/index.js#L217-L227

Specially line:
https://github.com/theganyo/swagger-node-runner/blob/3f5c099161ed7f526338091612463d5fc3c91880/index.js#L221

I don't feel maintaining a fork for this issue is a good idea. We will take care of this issue along with #2146

@shuse2
Copy link
Collaborator

shuse2 commented Jun 29, 2018

Removing the definition not directly used in API, which actually should not be part of API doc, should solve this problem.

@nazarhussain
Copy link
Contributor

Those definitions will not be referenced in the API when we will upgrade the Swagger to 3.0

@MaciejBaj MaciejBaj modified the milestones: Version 1.1.0, Version 1.2.0 Jul 4, 2018
@nazarhussain
Copy link
Contributor

nazarhussain commented Aug 2, 2018

@diego-G The issue can be started when the PR apigee-127/swagger-node-runner#134 is merged and released. Until then please move this issue to some other release.

@shuse2
Copy link
Collaborator

shuse2 commented Jul 29, 2019

As of [email protected], this was addressed

@shuse2 shuse2 closed this as completed Jul 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants