Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
35206664
Commit
35206664
authored
9 years ago
by
Suma S
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #134 from shwethags/BUG-37449
BUG-37449 create a type return can be improved to return better json
parents
e24e0265
c073f640
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
TypesResource.java
...g/apache/hadoop/metadata/web/resources/TypesResource.java
+6
-6
No files found.
webapp/src/main/java/org/apache/hadoop/metadata/web/resources/TypesResource.java
View file @
35206664
...
...
@@ -45,6 +45,7 @@ import javax.ws.rs.WebApplicationException;
import
javax.ws.rs.core.Context
;
import
javax.ws.rs.core.Response
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -87,18 +88,17 @@ public class TypesResource {
JSONObject
typesJson
=
metadataService
.
createType
(
typeDefinition
);
final
JSONArray
typesJsonArray
=
typesJson
.
getJSONArray
(
MetadataServiceClient
.
TYPES
);
List
<
Map
<
String
,
String
>>
typesAddedList
=
new
ArrayList
<>
();
JSONArray
typesResponse
=
new
JSONArray
();
for
(
int
i
=
0
;
i
<
typesJsonArray
.
length
();
i
++)
{
final
String
name
=
typesJsonArray
.
getString
(
i
);
typesAddedList
.
add
(
new
HashMap
<
String
,
String
>()
{{
put
(
MetadataServiceClient
.
NAME
,
name
);
}});
typesResponse
.
put
(
new
JSONObject
()
{{
put
(
MetadataServiceClient
.
NAME
,
name
);
}});
}
JSONObject
response
=
new
JSONObject
();
response
.
put
(
MetadataServiceClient
.
REQUEST_ID
,
Servlets
.
getRequestId
());
response
.
put
(
MetadataServiceClient
.
TYPES
,
types
AddedList
);
response
.
put
(
MetadataServiceClient
.
TYPES
,
types
Response
);
return
Response
.
status
(
ClientResponse
.
Status
.
CREATED
).
entity
(
response
).
build
();
}
catch
(
MetadataException
|
IllegalArgumentException
e
)
{
LOG
.
error
(
"Unable to persist types"
,
e
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment