This repository has been archived by the owner on Aug 20, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Create mocks in API imported from swagger/OAI
This closes gravitee-io/issues#1567
- Loading branch information
Showing
11 changed files
with
601 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 109 additions & 0 deletions
109
...agement-api-model/src/main/java/io/gravitee/management/model/api/NewSwaggerApiEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
/** | ||
* Copyright (C) 2015 The Gravitee team (http://gravitee.io) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.gravitee.management.model.api; | ||
|
||
import javax.validation.constraints.NotNull; | ||
import java.util.List; | ||
import java.util.Set; | ||
|
||
/** | ||
* @author Azize ELAMRANI (azize.elamrani at graviteesource.com) | ||
* @author GraviteeSource Team | ||
*/ | ||
public class NewSwaggerApiEntity { | ||
|
||
@NotNull | ||
private String name; | ||
@NotNull | ||
private String version; | ||
@NotNull | ||
private String description; | ||
@NotNull | ||
private String contextPath; | ||
@NotNull | ||
private String endpoint; | ||
private Set<String> groups; | ||
private List<SwaggerPath> paths; | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getVersion() { | ||
return version; | ||
} | ||
|
||
public void setVersion(String version) { | ||
this.version = version; | ||
} | ||
|
||
public String getDescription() { | ||
return description; | ||
} | ||
|
||
public void setDescription(String description) { | ||
this.description = description; | ||
} | ||
|
||
public String getContextPath() { | ||
return contextPath; | ||
} | ||
|
||
public void setContextPath(String contextPath) { | ||
this.contextPath = contextPath; | ||
} | ||
|
||
public String getEndpoint() { | ||
return endpoint; | ||
} | ||
|
||
public void setEndpoint(String endpoint) { | ||
this.endpoint = endpoint; | ||
} | ||
|
||
public List<SwaggerPath> getPaths() { | ||
return paths; | ||
} | ||
|
||
public void setPaths(List<SwaggerPath> paths) { | ||
this.paths = paths; | ||
} | ||
|
||
public Set<String> getGroups() { | ||
return groups; | ||
} | ||
|
||
public void setGroups(Set<String> groups) { | ||
this.groups = groups; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "NewSwaggerApiEntity{" + | ||
"name='" + name + '\'' + | ||
", version='" + version + '\'' + | ||
", description='" + description + '\'' + | ||
", contextPath='" + contextPath + '\'' + | ||
", endpoint='" + endpoint + '\'' + | ||
", groups=" + groups + | ||
", paths=" + paths + | ||
'}'; | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
...itee-management-api-model/src/main/java/io/gravitee/management/model/api/SwaggerPath.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/** | ||
* Copyright (C) 2015 The Gravitee team (http://gravitee.io) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.gravitee.management.model.api; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* @author Azize ELAMRANI (azize.elamrani at graviteesource.com) | ||
* @author GraviteeSource Team | ||
*/ | ||
public class SwaggerPath { | ||
|
||
private String path; | ||
private List<SwaggerVerb> verbs; | ||
|
||
public String getPath() { | ||
return path; | ||
} | ||
|
||
public void setPath(String path) { | ||
this.path = path; | ||
} | ||
|
||
public List<SwaggerVerb> getVerbs() { | ||
return verbs; | ||
} | ||
|
||
public void setVerbs(List<SwaggerVerb> verbs) { | ||
this.verbs = verbs; | ||
} | ||
} |
71 changes: 71 additions & 0 deletions
71
...itee-management-api-model/src/main/java/io/gravitee/management/model/api/SwaggerVerb.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/** | ||
* Copyright (C) 2015 The Gravitee team (http://gravitee.io) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.gravitee.management.model.api; | ||
|
||
import java.util.Map; | ||
|
||
/** | ||
* @author Azize ELAMRANI (azize.elamrani at graviteesource.com) | ||
* @author GraviteeSource Team | ||
*/ | ||
public class SwaggerVerb { | ||
|
||
private String verb; | ||
private String description; | ||
private String responseStatus; | ||
private String responseType; | ||
private Map<String, Object> responseProperties; | ||
|
||
public String getVerb() { | ||
return verb; | ||
} | ||
|
||
public void setVerb(String verb) { | ||
this.verb = verb; | ||
} | ||
|
||
public String getDescription() { | ||
return description; | ||
} | ||
|
||
public void setDescription(String description) { | ||
this.description = description; | ||
} | ||
|
||
public String getResponseStatus() { | ||
return responseStatus; | ||
} | ||
|
||
public void setResponseStatus(String responseStatus) { | ||
this.responseStatus = responseStatus; | ||
} | ||
|
||
public String getResponseType() { | ||
return responseType; | ||
} | ||
|
||
public void setResponseType(String responseType) { | ||
this.responseType = responseType; | ||
} | ||
|
||
public Map<String, Object> getResponseProperties() { | ||
return responseProperties; | ||
} | ||
|
||
public void setResponseProperties(Map<String, Object> responseProperties) { | ||
this.responseProperties = responseProperties; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.