Skip to content
This repository has been archived by the owner on Apr 13, 2022. It is now read-only.

Swagger api #140

Merged
merged 32 commits into from
Jan 11, 2018
Merged

Swagger api #140

merged 32 commits into from
Jan 11, 2018

Conversation

catena2w
Copy link
Contributor

No description provided.

@catena2w catena2w added the wip label Dec 20, 2017
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 434275e on swagger-api into ** on master**.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 5059062 on swagger-api into ** on master**.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 1aa80b0 on swagger-api into ** on master**.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling ec9a2e6 on swagger-api into ** on master**.


/peers/connect:
post:
summary: Get current size of the unconfirmed transactions pool

Choose a reason for hiding this comment

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

Is this summary correct?

"com.github.mpilquist" % "simulacrum_2.12" % "0.10.0",
"com.github.swagger-akka-http" % "swagger-akka-http_2.12" % "0.10.0",
"com.google.guava" % "guava" % "20.0",
"com.google.guava" % "guava" % "19.0",

Choose a reason for hiding this comment

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

Why go down from 20.0 to 19.0?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Library, that required guava 20 was removed, we now only have libraries that require guava 19 in dependencies

@@ -15,25 +15,32 @@ trait ApiRoute extends Directives {
val context: ActorRefFactory
val route: Route

implicit val timeout = Timeout(settings.timeout)
implicit lazy val timeout: Timeout = Timeout(settings.timeout)

Choose a reason for hiding this comment

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

Is this timeout still used? Maybe this line could be removed?

Choose a reason for hiding this comment

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

Or is it required as an implicit argument somewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is required in a lot of API routes as a timeout for requests to actors. Check ApiRouteWithFullView for example

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 3b60395 on swagger-api into ** on master**.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 5379653 on swagger-api into ** on master**.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 29d8205 on swagger-api into ** on master**.

# Conflicts:
#	src/main/scala/scorex/core/api/http/PeersApiRoute.scala
#	src/main/scala/scorex/core/api/http/swagger/SwaggerDocService.scala
@Tolsi Tolsi requested review from ceilican and removed request for ceilican December 25, 2017 12:40
@Tolsi Tolsi removed the wip label Dec 25, 2017
@ceilican
Copy link
Contributor

@Tolsi , the CI build is failing.

Copy link
Contributor

@ceilican ceilican left a comment

Choose a reason for hiding this comment

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

I noticed that all @Path, @ApiOperation and @ApiImplicitParams annotations were removed.

Do I understand correctly that goal is to document the API in "yaml" files (e.g. examples/src/main/resources/api/testApi.yaml) from now on, to conform with newer openapi conventions?

Some of the information that we had in annotations has not been added to any yaml file (yet). The examples/src/main/resources/api/testApi.yaml, for instance, contains documentation only for a few paths. Many paths that were documented with annotations before would have no documentation if this PR were accepted in its current state. There would be a loss of documentation coverage. Would that be ok? Shouldn't we try to maintain and increase our documentation coverage level?


/peers/connect:
post:
summary: Get current size of the unconfirmed transactions pool
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this the correct summary for this path?

Copy link
Contributor

@terjokhin terjokhin Dec 26, 2017

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Your fix seems good to me.

Copy link
Contributor

Choose a reason for hiding this comment

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

@ceilican But it was done in ergo repository =)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I know. I think it should be done here (in Scorex, in this PR) too.

And I wonder if it would be possible/desirable, in the future (in another PR), to reduce code and documentation duplication at the api level between scorex('s example) and ergo. It seems to me that right now duplication is only avoided at the network layer. All other layers remain completely abstract in Scorex's core and need to be (re-)implemented, possibly in similar ways, by every blockchain system built with Scorex. Perhaps, in the future, Scorex could provide some standard api routes/paths already pre-implemented.

@Daron666, is ergo's api significantly different from the api of scorex's example?

@kushti, should we include the api into the scope of that architecture review that we have discussed?

Copy link
Contributor

Choose a reason for hiding this comment

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

@ceilican Ergo's api is a superset over scorex api.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 45.681% when pulling 8fc4d79 on swagger-api into b0b0d64 on master.

…ger-api

 Conflicts:
	examples/src/main/scala/examples/hybrid/api/http/StatsApiRoute.scala
	src/main/scala/scorex/core/api/http/PeersApiRoute.scala
	src/main/scala/scorex/core/api/http/UtilsApiRoute.scala
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.06%) to 45.62% when pulling 9c41b1f on swagger-api into 00794b6 on master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 45.681% when pulling 674d12c on swagger-api into 00794b6 on master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 45.681% when pulling 1244675 on swagger-api into 00794b6 on master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 45.681% when pulling d1f0458 on swagger-api into 00794b6 on master.

@catena2w
Copy link
Contributor Author

catena2w commented Jan 8, 2018

@ceilican review pleasse

@coveralls
Copy link

Coverage Status

Coverage remained the same at 45.681% when pulling 2c3620d on swagger-api into 00794b6 on master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 45.681% when pulling 93d4307 on swagger-api into fd58270 on master.

@kushti kushti merged commit a3a7522 into master Jan 11, 2018
@Tolsi Tolsi deleted the swagger-api branch January 11, 2018 10:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants