{"action":"created","comment":{"url":"https://api.github.com/repos/geoserver/geoserver/pulls/comments/351297801","pull_request_review_id":323686589,"id":351297801,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDM1MTI5NzgwMQ==","diff_hunk":"@@ -365,20 +369,63 @@ public final XSDSchema buildSchemaInternal(\n         return schema;\n     }\n \n-    private void addAllNamespacesFromCatalog(XSDSchema schema) {\n-        WorkspaceInfo localWorkspace = LocalWorkspace.get();\n+    private void addRequiredNamespaces(FeatureTypeInfo[] featureTypeInfos, XSDSchema schema) {\n+        final WorkspaceInfo localWorkspace = LocalWorkspace.get();\n         if (localWorkspace != null) {\n             // deactivate workspace filtering\n             LocalWorkspace.remove();\n         }\n-        // add secondary namespaces from the full catalog\n         try {\n-            for (NamespaceInfo nameSpaceinfo : catalog.getNamespaces()) {\n-                if (!schema.getQNamePrefixToNamespaceMap().containsKey(nameSpaceinfo.getPrefix())) {\n-                    schema.getQNamePrefixToNamespaceMap()\n-                            .put(nameSpaceinfo.getPrefix(), nameSpaceinfo.getURI());\n+            if (localWorkspace != null && localWorkspace.isIsolated()) {\n+                // Isolated namespace, add only required namespaces from mappings\n+                final Map<String, String> schemaNamespacesMap =\n+                        schema.getQNamePrefixToNamespaceMap();\n+                final List<NamespaceInfo> catalogNamespaces = catalog.getNamespaces();\n+                for (FeatureTypeInfo featureTypeInfo : featureTypeInfos) {\n+                    Object mapObject =\n+                            featureTypeInfo\n+                                    .getFeatureType()\n+                                    .getUserData()\n+                                    .get(Types.DECLARED_NAMESPACES_MAP);\n+                    if (!(mapObject instanceof Map)) continue;","path":"src/wfs/src/main/java/org/geoserver/wfs/xml/FeatureTypeSchemaBuilder.java","position":72,"original_position":72,"commit_id":"8b448e5d7d9aa3373edb3546a8093b0363d39fe2","original_commit_id":"8b448e5d7d9aa3373edb3546a8093b0363d39fe2","user":{"login":"fernandor777","id":3613119,"node_id":"MDQ6VXNlcjM2MTMxMTk=","avatar_url":"https://avatars1.githubusercontent.com/u/3613119?v=4","gravatar_id":"","url":"https://api.github.com/users/fernandor777","html_url":"https://github.com/fernandor777","followers_url":"https://api.github.com/users/fernandor777/followers","following_url":"https://api.github.com/users/fernandor777/following{/other_user}","gists_url":"https://api.github.com/users/fernandor777/gists{/gist_id}","starred_url":"https://api.github.com/users/fernandor777/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fernandor777/subscriptions","organizations_url":"https://api.github.com/users/fernandor777/orgs","repos_url":"https://api.github.com/users/fernandor777/repos","events_url":"https://api.github.com/users/fernandor777/events{/privacy}","received_events_url":"https://api.github.com/users/fernandor777/received_events","type":"User","site_admin":false},"body":"This method is only used when it is a complex feature case, so simple features namespaces handling is not touched.  The only-on-insolated-workspace condition enforce is for backward compatibility.","created_at":"2019-11-27T13:50:28Z","updated_at":"2019-11-27T13:50:29Z","html_url":"https://github.com/geoserver/geoserver/pull/3871#discussion_r351297801","pull_request_url":"https://api.github.com/repos/geoserver/geoserver/pulls/3871","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/geoserver/geoserver/pulls/comments/351297801"},"html":{"href":"https://github.com/geoserver/geoserver/pull/3871#discussion_r351297801"},"pull_request":{"href":"https://api.github.com/repos/geoserver/geoserver/pulls/3871"}},"in_reply_to_id":350081332},"pull_request":{"url":"https://api.github.com/repos/geoserver/geoserver/pulls/3871","id":334482886,"node_id":"MDExOlB1bGxSZXF1ZXN0MzM0NDgyODg2","html_url":"https://github.com/geoserver/geoserver/pull/3871","diff_url":"https://github.com/geoserver/geoserver/pull/3871.diff","patch_url":"https://github.com/geoserver/geoserver/pull/3871.patch","issue_url":"https://api.github.com/repos/geoserver/geoserver/issues/3871","number":3871,"state":"open","locked":false,"title":"[GEOS-9388] App-Schema WFS GetFeature includes namespaces for all workspaces on isolated workspace","user":{"login":"fernandor777","id":3613119,"node_id":"MDQ6VXNlcjM2MTMxMTk=","avatar_url":"https://avatars1.githubusercontent.com/u/3613119?v=4","gravatar_id":"","url":"https://api.github.com/users/fernandor777","html_url":"https://github.com/fernandor777","followers_url":"https://api.github.com/users/fernandor777/followers","following_url":"https://api.github.com/users/fernandor777/following{/other_user}","gists_url":"https://api.github.com/users/fernandor777/gists{/gist_id}","starred_url":"https://api.github.com/users/fernandor777/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fernandor777/subscriptions","organizations_url":"https://api.github.com/users/fernandor777/orgs","repos_url":"https://api.github.com/users/fernandor777/repos","events_url":"https://api.github.com/users/fernandor777/events{/privacy}","received_events_url":"https://api.github.com/users/fernandor777/received_events","type":"User","site_admin":false},"body":"App-Schema WFS GetFeature GML 3.1 and 3.2 reponses include namespaces from all workspaces on isolated workspace (virtual service) request.  This PR fixes this issue.\r\n\r\nRequires:\r\nhttps://github.com/geotools/geotools/pull/2674\r\n\r\nJIRA issue:\r\nhttps://osgeo-org.atlassian.net/browse/GEOS-9388\r\n\r\n## Checklist\r\n\r\n> Reviewing is a process done by project maintainers, mostly on a volunteer basis. We try to keep the overhead as small as possible and appreciate if you help us to do so by completing the following items. Feel free to ask in a comment if you have troubles with any of them.\r\n\r\nFor all pull requests:\r\n\r\n- [x] Confirm you have read the [contribution guidelines](https://github.com/geoserver/geoserver/blob/master/CONTRIBUTING.md) \r\n- [x] You have sent a Contribution Licence Agreement (CLA) as necessary (not required for small changes, e.g., fixing typos in documentation)\r\n- [x] Make sure the first PR targets the master branch, eventual backports will be managed later. This can be ignored if the PR is fixing an issue that only happens in a specific branch, but not in newer ones.\r\n\r\nThe following are required only for core and extension modules (they are welcomed, but not required, for community modules):\r\n- [x] There is a ticket in Jira describing the issue/improvement/feature (a notable exemptions is, changes not visible to end users)\r\n- [x] PR for bug fixes and small new features are presented as a single commit\r\n- [x] Commit message must be in the form \"[GEOS-XYZW] Title of the Jira ticket\" (export to XML in Jira generates the message in this exact form)\r\n- [x] New unit tests have been added covering the changes\r\n- [ ] This PR passes all existing unit tests (test results will be reported by travis-ci after opening this PR)\r\n- [ ] This PR passes the [QA checks](https://docs.geoserver.org/latest/en/developer/qa-guide/index.html) (QA checks results will be reported by travis-ci after opening this PR)\r\n- [x] Commits changing the UI, existing user workflows, or adding new functionality, need to include documentation updates\r\n\r\nSubmitting the PR does not require you to check all items, but by the time it gets merged, they should be either satisfied or inapplicable.\r\n","created_at":"2019-10-30T19:54:31Z","updated_at":"2019-11-27T13:50:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2dc639a0ed7ea5a19a986d8429aaf52a2139ce2e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/geoserver/geoserver/pulls/3871/commits","review_comments_url":"https://api.github.com/repos/geoserver/geoserver/pulls/3871/comments","review_comment_url":"https://api.github.com/repos/geoserver/geoserver/pulls/comments{/number}","comments_url":"https://api.github.com/repos/geoserver/geoserver/issues/3871/comments","statuses_url":"https://api.github.com/repos/geoserver/geoserver/statuses/8b448e5d7d9aa3373edb3546a8093b0363d39fe2","head":{"label":"fernandor777:namespaces-isolated","ref":"namespaces-isolated","sha":"8b448e5d7d9aa3373edb3546a8093b0363d39fe2","user":{"login":"fernandor777","id":3613119,"node_id":"MDQ6VXNlcjM2MTMxMTk=","avatar_url":"https://avatars1.githubusercontent.com/u/3613119?v=4","gravatar_id":"","url":"https://api.github.com/users/fernandor777","html_url":"https://github.com/fernandor777","followers_url":"https://api.github.com/users/fernandor777/followers","following_url":"https://api.github.com/users/fernandor777/following{/other_user}","gists_url":"https://api.github.com/users/fernandor777/gists{/gist_id}","starred_url":"https://api.github.com/users/fernandor777/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fernandor777/subscriptions","organizations_url":"https://api.github.com/users/fernandor777/orgs","repos_url":"https://api.github.com/users/fernandor777/repos","events_url":"https://api.github.com/users/fernandor777/events{/privacy}","received_events_url":"https://api.github.com/users/fernandor777/received_events","type":"User","site_admin":false},"repo":{"id":130398421,"node_id":"MDEwOlJlcG9zaXRvcnkxMzAzOTg0MjE=","name":"geoserver","full_name":"fernandor777/geoserver","private":false,"owner":{"login":"fernandor777","id":3613119,"node_id":"MDQ6VXNlcjM2MTMxMTk=","avatar_url":"https://avatars1.githubusercontent.com/u/3613119?v=4","gravatar_id":"","url":"https://api.github.com/users/fernandor777","html_url":"https://github.com/fernandor777","followers_url":"https://api.github.com/users/fernandor777/followers","following_url":"https://api.github.com/users/fernandor777/following{/other_user}","gists_url":"https://api.github.com/users/fernandor777/gists{/gist_id}","starred_url":"https://api.github.com/users/fernandor777/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fernandor777/subscriptions","organizations_url":"https://api.github.com/users/fernandor777/orgs","repos_url":"https://api.github.com/users/fernandor777/repos","events_url":"https://api.github.com/users/fernandor777/events{/privacy}","received_events_url":"https://api.github.com/users/fernandor777/received_events","type":"User","site_admin":false},"html_url":"https://github.com/fernandor777/geoserver","description":"Official GeoServer repository","fork":true,"url":"https://api.github.com/repos/fernandor777/geoserver","forks_url":"https://api.github.com/repos/fernandor777/geoserver/forks","keys_url":"https://api.github.com/repos/fernandor777/geoserver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fernandor777/geoserver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fernandor777/geoserver/teams","hooks_url":"https://api.github.com/repos/fernandor777/geoserver/hooks","issue_events_url":"https://api.github.com/repos/fernandor777/geoserver/issues/events{/number}","events_url":"https://api.github.com/repos/fernandor777/geoserver/events","assignees_url":"https://api.github.com/repos/fernandor777/geoserver/assignees{/user}","branches_url":"https://api.github.com/repos/fernandor777/geoserver/branches{/branch}","tags_url":"https://api.github.com/repos/fernandor777/geoserver/tags","blobs_url":"https://api.github.com/repos/fernandor777/geoserver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fernandor777/geoserver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fernandor777/geoserver/git/refs{/sha}","trees_url":"https://api.github.com/repos/fernandor777/geoserver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fernandor777/geoserver/statuses/{sha}","languages_url":"https://api.github.com/repos/fernandor777/geoserver/languages","stargazers_url":"https://api.github.com/repos/fernandor777/geoserver/stargazers","contributors_url":"https://api.github.com/repos/fernandor777/geoserver/contributors","subscribers_url":"https://api.github.com/repos/fernandor777/geoserver/subscribers","subscription_url":"https://api.github.com/repos/fernandor777/geoserver/subscription","commits_url":"https://api.github.com/repos/fernandor777/geoserver/commits{/sha}","git_commits_url":"https://api.github.com/repos/fernandor777/geoserver/git/commits{/sha}","comments_url":"https://api.github.com/repos/fernandor777/geoserver/comments{/number}","issue_comment_url":"https://api.github.com/repos/fernandor777/geoserver/issues/comments{/number}","contents_url":"https://api.github.com/repos/fernandor777/geoserver/contents/{+path}","compare_url":"https://api.github.com/repos/fernandor777/geoserver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fernandor777/geoserver/merges","archive_url":"https://api.github.com/repos/fernandor777/geoserver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fernandor777/geoserver/downloads","issues_url":"https://api.github.com/repos/fernandor777/geoserver/issues{/number}","pulls_url":"https://api.github.com/repos/fernandor777/geoserver/pulls{/number}","milestones_url":"https://api.github.com/repos/fernandor777/geoserver/milestones{/number}","notifications_url":"https://api.github.com/repos/fernandor777/geoserver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fernandor777/geoserver/labels{/name}","releases_url":"https://api.github.com/repos/fernandor777/geoserver/releases{/id}","deployments_url":"https://api.github.com/repos/fernandor777/geoserver/deployments","created_at":"2018-04-20T18:15:57Z","updated_at":"2019-11-19T13:11:31Z","pushed_at":"2019-11-27T13:30:32Z","git_url":"git://github.com/fernandor777/geoserver.git","ssh_url":"git@github.com:fernandor777/geoserver.git","clone_url":"https://github.com/fernandor777/geoserver.git","svn_url":"https://github.com/fernandor777/geoserver","homepage":"http://geoserver.org/","size":227751,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"geoserver:master","ref":"master","sha":"27ce396619fc4dcd0bd9ddc95bc946edaa03155d","user":{"login":"geoserver","id":186522,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4NjUyMg==","avatar_url":"https://avatars2.githubusercontent.com/u/186522?v=4","gravatar_id":"","url":"https://api.github.com/users/geoserver","html_url":"https://github.com/geoserver","followers_url":"https://api.github.com/users/geoserver/followers","following_url":"https://api.github.com/users/geoserver/following{/other_user}","gists_url":"https://api.github.com/users/geoserver/gists{/gist_id}","starred_url":"https://api.github.com/users/geoserver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geoserver/subscriptions","organizations_url":"https://api.github.com/users/geoserver/orgs","repos_url":"https://api.github.com/users/geoserver/repos","events_url":"https://api.github.com/users/geoserver/events{/privacy}","received_events_url":"https://api.github.com/users/geoserver/received_events","type":"Organization","site_admin":false},"repo":{"id":2751199,"node_id":"MDEwOlJlcG9zaXRvcnkyNzUxMTk5","name":"geoserver","full_name":"geoserver/geoserver","private":false,"owner":{"login":"geoserver","id":186522,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4NjUyMg==","avatar_url":"https://avatars2.githubusercontent.com/u/186522?v=4","gravatar_id":"","url":"https://api.github.com/users/geoserver","html_url":"https://github.com/geoserver","followers_url":"https://api.github.com/users/geoserver/followers","following_url":"https://api.github.com/users/geoserver/following{/other_user}","gists_url":"https://api.github.com/users/geoserver/gists{/gist_id}","starred_url":"https://api.github.com/users/geoserver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geoserver/subscriptions","organizations_url":"https://api.github.com/users/geoserver/orgs","repos_url":"https://api.github.com/users/geoserver/repos","events_url":"https://api.github.com/users/geoserver/events{/privacy}","received_events_url":"https://api.github.com/users/geoserver/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/geoserver/geoserver","description":"Official GeoServer repository","fork":false,"url":"https://api.github.com/repos/geoserver/geoserver","forks_url":"https://api.github.com/repos/geoserver/geoserver/forks","keys_url":"https://api.github.com/repos/geoserver/geoserver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/geoserver/geoserver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/geoserver/geoserver/teams","hooks_url":"https://api.github.com/repos/geoserver/geoserver/hooks","issue_events_url":"https://api.github.com/repos/geoserver/geoserver/issues/events{/number}","events_url":"https://api.github.com/repos/geoserver/geoserver/events","assignees_url":"https://api.github.com/repos/geoserver/geoserver/assignees{/user}","branches_url":"https://api.github.com/repos/geoserver/geoserver/branches{/branch}","tags_url":"https://api.github.com/repos/geoserver/geoserver/tags","blobs_url":"https://api.github.com/repos/geoserver/geoserver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/geoserver/geoserver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/geoserver/geoserver/git/refs{/sha}","trees_url":"https://api.github.com/repos/geoserver/geoserver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/geoserver/geoserver/statuses/{sha}","languages_url":"https://api.github.com/repos/geoserver/geoserver/languages","stargazers_url":"https://api.github.com/repos/geoserver/geoserver/stargazers","contributors_url":"https://api.github.com/repos/geoserver/geoserver/contributors","subscribers_url":"https://api.github.com/repos/geoserver/geoserver/subscribers","subscription_url":"https://api.github.com/repos/geoserver/geoserver/subscription","commits_url":"https://api.github.com/repos/geoserver/geoserver/commits{/sha}","git_commits_url":"https://api.github.com/repos/geoserver/geoserver/git/commits{/sha}","comments_url":"https://api.github.com/repos/geoserver/geoserver/comments{/number}","issue_comment_url":"https://api.github.com/repos/geoserver/geoserver/issues/comments{/number}","contents_url":"https://api.github.com/repos/geoserver/geoserver/contents/{+path}","compare_url":"https://api.github.com/repos/geoserver/geoserver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/geoserver/geoserver/merges","archive_url":"https://api.github.com/repos/geoserver/geoserver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/geoserver/geoserver/downloads","issues_url":"https://api.github.com/repos/geoserver/geoserver/issues{/number}","pulls_url":"https://api.github.com/repos/geoserver/geoserver/pulls{/number}","milestones_url":"https://api.github.com/repos/geoserver/geoserver/milestones{/number}","notifications_url":"https://api.github.com/repos/geoserver/geoserver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/geoserver/geoserver/labels{/name}","releases_url":"https://api.github.com/repos/geoserver/geoserver/releases{/id}","deployments_url":"https://api.github.com/repos/geoserver/geoserver/deployments","created_at":"2011-11-10T19:56:06Z","updated_at":"2019-11-27T10:59:49Z","pushed_at":"2019-11-27T13:30:37Z","git_url":"git://github.com/geoserver/geoserver.git","ssh_url":"git@github.com:geoserver/geoserver.git","clone_url":"https://github.com/geoserver/geoserver.git","svn_url":"https://github.com/geoserver/geoserver","homepage":"http://geoserver.org/","size":229104,"stargazers_count":1735,"watchers_count":1735,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1373,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":19,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":1373,"open_issues":19,"watchers":1735,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/geoserver/geoserver/pulls/3871"},"html":{"href":"https://github.com/geoserver/geoserver/pull/3871"},"issue":{"href":"https://api.github.com/repos/geoserver/geoserver/issues/3871"},"comments":{"href":"https://api.github.com/repos/geoserver/geoserver/issues/3871/comments"},"review_comments":{"href":"https://api.github.com/repos/geoserver/geoserver/pulls/3871/comments"},"review_comment":{"href":"https://api.github.com/repos/geoserver/geoserver/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/geoserver/geoserver/pulls/3871/commits"},"statuses":{"href":"https://api.github.com/repos/geoserver/geoserver/statuses/8b448e5d7d9aa3373edb3546a8093b0363d39fe2"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"fernandor777"}}