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

Generate swagger from a package and update swagger for delete-environ… #354

Merged
merged 2 commits into from
Jan 25, 2018

Conversation

wbingli
Copy link
Contributor

@wbingli wbingli commented Jan 25, 2018

Summary

Update the swagger file for delete-environment API.

  • update the gradle task to generate the swagger based on package scan.
  • Remove the x-generated-at in the swagger file

Testing

gradle build

Licensing

This contribution is under the terms of the Apache 2.0 License: Yes

@wbingli wbingli requested review from wjbuys and xjhe January 25, 2018 01:07
Copy link
Contributor

@wjbuys wjbuys left a comment

Choose a reason for hiding this comment

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

LGTM, optional minor fixes as you see fit

.filterInputsBy(new FilterBuilder().includePackage(pkg)));
Set<Class<?>> springMVCClasses =
reflections.getTypesAnnotatedWith(
org.springframework.web.bind.annotation.RestController.class);
Copy link
Contributor

Choose a reason for hiding this comment

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

Hm, we don't have a direct dependency on this in the build.gradle, is it coming in as a transitive dependency? Might be worth adding an explicit dependency in that case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it comes from the "swagger-maven-plugin", which we use to generate swagger from Spring mvc.

Not sure what's the value we add for explicit dependency for spring-web. I would see it's better to use the transitive dependency from swagger to avoid potential problem to maintain the same spring version within swagger or different spring versions.

@@ -60,15 60,8 @@ task swagger(type: GenerateSwaggerModel, dependsOn: classes) {
scanClasspath = project.sourceSets.main.runtimeClasspath

// TODO: Specify API classes by package rather than name
Copy link
Contributor

Choose a reason for hiding this comment

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

You can probably remove this TODO now ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do

/** A list of class names to scan for Swagger annotations */
@Input private List<String> apiClasses = new ArrayList<>();
/** A list of package names to scan for swagger annotations */
@Input private List<String> apiPackages = new ArrayList<>();
Copy link
Contributor

Choose a reason for hiding this comment

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

🎉

@wbingli wbingli merged commit 21e5da5 into blox:dev Jan 25, 2018
@wbingli wbingli deleted the swagger_update_for_delete_env branch January 25, 2018 22:28
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.

2 participants