Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: json schema for join tag #87

Merged
merged 1 commit into from Oct 6, 2019

Conversation

@hugbe8
Copy link
Contributor

hugbe8 commented Oct 4, 2019

mappyfile: Version: 0.8.2

fix: schema layer.json for joins tag
fix: schema join.json for connectiontype tag

Note: The validate function does not manage the tag: joins and connectiontype, while the transform fonction (map to json) does it.

Reference: https://mapserver.org/mapfile/join.html

Error received on the validate function:

{'error': "'joins' does not match any of the regexes: '^__[a-z]+__$'", 'message': 'ERROR: Invalid value in LAYER'}
{'error': "'connectiontype' does not match any of the regexes: '^__[a-z]+__$'", 'message': 'ERROR: Invalid value in JOIN'}

MapFile abstract:

JOIN
	NAME 'table_join'
	CONNECTION "dbname=bd_test host=host_test port=5432 user=mapserver password={***}"
	CONNECTIONTYPE postgresql
	TABLE 'sch.table_join'
	FROM 'no_link'
	TO 'no_link'
	TYPE ONE-TO-MANY
	TEMPLATE "../gabarits/gabarit_join.html"
END

JSON-MapFile Abstract:

"joins": [
	{
		"__type__": "join",
		"name": "table_join",
		"connection": "dbname=bd_test host=host_test port=5432 user=mapserver password={***}",
		"connectiontype": "postgresql",
		"table": "sch.table_join",
		"from": "no_link",
		"to": "no_link",
		"type": "ONE-TO-MANY",
		"template": "../gabarits/gabarit_join.html"
	}
],
fix: schema join.json for connectiontype tag

Note: The validate function does not manage the tag: joins and connectiontype, while the transform fonction (map to json) does it.

Error received on the validate function:
	{'error': "'joins' does not match any of the regexes: '^__[a-z]+__$'", 'message': 'ERROR: Invalid value in LAYER'}
	{'error': "'connectiontype' does not match any of the regexes: '^__[a-z]+__$'", 'message': 'ERROR: Invalid value in JOIN'}

MapFile abstract:
	JOIN
		NAME 'table_join'
		CONNECTION "dbname=bd_test host=host_test port=5432 user=mapserver password={***}"
		CONNECTIONTYPE postgresql
		TABLE 'sch.table_join'
		FROM 'no_link'
		TO 'no_link'
		TYPE ONE-TO-MANY
		TEMPLATE "../gabarits/gabarit_join.html"
	END

JSON-MapFile Abstract:
	"joins": [
		{
			"__type__": "join",
			"name": "table_join",
			"connection": "dbname=bd_test host=host_test port=5432 user=mapserver password={***}",
			"connectiontype": "postgresql",
			"table": "sch.table_join",
			"from": "no_link",
			"to": "no_link",
			"type": "ONE-TO-MANY",
			"template": "../gabarits/gabarit_join.html"
		}
	],
@coveralls

This comment has been minimized.

Copy link

coveralls commented Oct 4, 2019

Pull Request Test Coverage Report for Build 396

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.3%) to 90.212%

Totals Coverage Status
Change from base Build 393: -0.3%
Covered Lines: 5539
Relevant Lines: 6140

💛 - Coveralls
@geographika geographika merged commit 90741fd into geographika:master Oct 6, 2019
2 of 3 checks passed
2 of 3 checks passed
coverage/coveralls Coverage decreased (-0.3%) to 90.212%
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@geographika

This comment has been minimized.

Copy link
Owner

geographika commented Oct 6, 2019

@hugbe8 - thanks for this. I double-checked mapfile.c that a layer can have multiple joins (I couldn't find this in the docs or msautotest). Coveralls percentage has dropped somehow, but the JSON looks good.

@hugbe8 hugbe8 deleted the hugbe8:fix_validateSchema_Join branch Oct 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.