author
int64
658
755k
date
stringlengths
19
19
timezone
int64
-46,800
43.2k
hash
stringlengths
40
40
message
stringlengths
5
490
mods
list
language
stringclasses
20 values
license
stringclasses
3 values
repo
stringlengths
5
68
original_message
stringlengths
12
491
393,976
07.05.2018 11:30:48
-7,200
aebc9c5f7d7731ffcec01ff4d7c2f71398428dc7
added test for Dict() and fixed tests to be more precise
[ { "change_type": "MODIFY", "old_path": "tests/test_ext_marshmallow.py", "new_path": "tests/test_ext_marshmallow.py", "diff": "@@ -597,5 +597,13 @@ class TestDictValues:\nspec.definition('SchemaWithDict', schema=SchemaWithDict)\nresult = spec._definitions['SchemaWithDict']['properties']['dict_field']\n- assert 'additionalProperties' in result\n- assert result['additionalProperties']['type'] == 'string'\n+ assert result == {'type': 'object', 'additionalProperties': {'type': 'string'}}\n+\n+ def test_dict_with_empty_values_field(self, spec):\n+\n+ class SchemaWithDict(Schema):\n+ dict_field = Dict()\n+\n+ spec.definition('SchemaWithDict', schema=SchemaWithDict)\n+ result = spec._definitions['SchemaWithDict']['properties']['dict_field']\n+ assert result == {'type': 'object'}\n" } ]
Python
MIT License
marshmallow-code/apispec
added test for Dict() and fixed tests to be more precise
394,013
13.05.2018 20:36:57
25,200
3b6a2da6d13b8252217c7f60d49c38a29965359c
Generalize schema resolution for arrays
[ { "change_type": "MODIFY", "old_path": "AUTHORS.rst", "new_path": "AUTHORS.rst", "diff": "@@ -48,3 +48,4 @@ Contributors (chronological)\n- `@mathewmarcus <https://github.com/mathewmarcus>`_\n- Louis-Philippe Huberdeau `@lphuberdeau <https://github.com/lphuberdeau>`_\n- Urban `@UrKr <https://github.com/UrKr>`_\n+- Christina Long `@cvlong <https://github.com/cvlong>`_\n" }, { "change_type": "MODIFY", "old_path": "apispec/ext/marshmallow/__init__.py", "new_path": "apispec/ext/marshmallow/__init__.py", "diff": "@@ -189,7 +189,7 @@ def schema_operation_resolver(spec, operations, **kwargs):\nif 'requestBody' in operation: # OpenAPI 3\nresolve_schema_in_request_body(spec, operation['requestBody'])\nfor response in operation.get('responses', {}).values():\n- resolve_schema_in_response(spec, response)\n+ resolve_schema(spec, response)\ndef resolve_parameters(spec, parameters):\nresolved = []\n@@ -201,6 +201,7 @@ def resolve_parameters(spec, parameters):\nresolved += swagger.schema2parameters(\nschema_cls, default_in=parameter.pop('in'), spec=spec, **parameter)\ncontinue\n+ resolve_schema(spec, parameter)\nresolved.append(parameter)\nreturn resolved\n@@ -217,19 +218,19 @@ def resolve_schema_in_request_body(spec, request_body):\ncontent[content_type]['schema'] = resolve_schema_dict(spec, schema)\n-def resolve_schema_in_response(spec, response):\n- \"\"\"Function to resolve a schema in a response - modifies the response\n- dict to convert Marshmallow Schema object or class into dict\n+def resolve_schema(spec, data):\n+ \"\"\"Function to resolve a schema in a parameter or response - modifies the\n+ corresponding dict to convert Marshmallow Schema object or class into dict\n:param APISpec spec: `APISpec` containing refs.\n- :param dict response: the response dictionary that may contain a schema\n+ :param dict data: the parameter or response dictionary that may contain a schema\n\"\"\"\n- if 'schema' in response: # OpenAPI 2\n- response['schema'] = resolve_schema_dict(spec, response['schema'])\n- if 'content' in response: # OpenAPI 3\n- for content_type in response['content']:\n- schema = response['content'][content_type]['schema']\n- response['content'][content_type]['schema'] = resolve_schema_dict(spec, schema)\n+ if 'schema' in data: # OpenAPI 2\n+ data['schema'] = resolve_schema_dict(spec, data['schema'])\n+ if 'content' in data: # OpenAPI 3\n+ for content_type in data['content']:\n+ schema = data['content'][content_type]['schema']\n+ data['content'][content_type]['schema'] = resolve_schema_dict(spec, schema)\ndef resolve_schema_dict(spec, schema, dump=True, use_instances=False):\nif isinstance(schema, dict):\n" }, { "change_type": "MODIFY", "old_path": "tests/test_ext_marshmallow.py", "new_path": "tests/test_ext_marshmallow.py", "diff": "@@ -439,6 +439,11 @@ class TestOperationHelper:\n---\nget:\n+ parameters:\n+ - in: body\n+ schema:\n+ type: array\n+ items: tests.schemas.PetSchema\nresponses:\n200:\nschema:\n@@ -451,11 +456,15 @@ class TestOperationHelper:\np = spec._paths['/pet']\nassert 'get' in p\nop = p['get']\n+ assert 'parameters' in op\n+ len(op['parameters']) == 1\nassert 'responses' in op\n- assert op['responses'][200]['schema'] == {\n+ resolved_schema = {\n'type': 'array',\n'items': {'$ref': '#/definitions/Pet'}\n}\n+ assert op['parameters'][0]['schema'] == resolved_schema\n+ assert op['responses'][200]['schema'] == resolved_schema\ndef test_schema_partially_in_docstring(self, spec):\nspec.definition('Pet', schema=PetSchema)\n" } ]
Python
MIT License
marshmallow-code/apispec
Generalize schema resolution for arrays
394,013
14.05.2018 14:10:51
25,200
8f5b000624946516e3e25b5e9e0a71afc6c1188e
Add test for OpenAPI 3 with schema array in docstring
[ { "change_type": "MODIFY", "old_path": "tests/test_ext_marshmallow.py", "new_path": "tests/test_ext_marshmallow.py", "diff": "@@ -466,6 +466,42 @@ class TestOperationHelper:\nassert op['parameters'][0]['schema'] == resolved_schema\nassert op['responses'][200]['schema'] == resolved_schema\n+ def test_schema_array_in_docstring_uses_ref_if_available_v3(self, spec_3):\n+ def pet_view():\n+ \"\"\"Not much to see here.\n+\n+ ---\n+ get:\n+ parameters:\n+ - in: body\n+ content:\n+ application/json:\n+ schema:\n+ type: array\n+ items: tests.schemas.PetSchema\n+ responses:\n+ 200:\n+ content:\n+ application/json:\n+ schema:\n+ type: array\n+ items: tests.schemas.PetSchema\n+ \"\"\"\n+ return '...'\n+\n+ spec_3.add_path(path='/pet', view=pet_view)\n+ p = spec_3._paths['/pet']\n+ assert 'get' in p\n+ op = p['get']\n+ resolved_schema = {\n+ 'type': 'array',\n+ 'items': swagger.schema2jsonschema(PetSchema),\n+ }\n+ request_schema = op['parameters'][0]['content']['application/json']['schema']\n+ assert request_schema == resolved_schema\n+ response_schema = op['responses'][200]['content']['application/json']['schema']\n+ assert response_schema == resolved_schema\n+\ndef test_schema_partially_in_docstring(self, spec):\nspec.definition('Pet', schema=PetSchema)\n" } ]
Python
MIT License
marshmallow-code/apispec
Add test for OpenAPI 3 with schema array in docstring
394,025
24.05.2018 01:47:56
-28,800
f85b89cd6358404d0954061afc488fdbc7095932
Fix a typo in ext/bottle.py
[ { "change_type": "MODIFY", "old_path": "apispec/ext/bottle.py", "new_path": "apispec/ext/bottle.py", "diff": "@@ -51,7 +51,7 @@ def _route_for_view(app, view):\ndef path_from_router(spec, view, operations, **kwargs):\n- \"\"\"Path helper that allows passing a bottle view funciton.\"\"\"\n+ \"\"\"Path helper that allows passing a bottle view function.\"\"\"\noperations = utils.load_operations_from_docstring(view.__doc__)\napp = kwargs.get('app', _default_app)\nroute = _route_for_view(app, view)\n" } ]
Python
MIT License
marshmallow-code/apispec
Fix a typo in ext/bottle.py
393,999
27.05.2018 22:29:25
-28,800
f138f8ce00c1368e2caea0475a50f5290bdf0915
feat(ext.marshmallow): openapi 3.0 support for parameters
[ { "change_type": "MODIFY", "old_path": "apispec/ext/marshmallow/swagger.py", "new_path": "apispec/ext/marshmallow/swagger.py", "diff": "@@ -429,6 +429,11 @@ def fields2parameters(fields, schema=None, spec=None, use_refs=True,\nhttps://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#parameterObject\n\"\"\"\nswagger_default_in = __location_map__.get(default_in, default_in)\n+ if spec is None:\n+ openapi_major_version = 2\n+ else:\n+ openapi_major_version = spec.openapi_version.version[0]\n+\nif swagger_default_in == 'body':\nif schema is not None:\n# Prevent circular import\n@@ -464,7 +469,9 @@ def fields2parameters(fields, schema=None, spec=None, use_refs=True,\nname=_observed_name(field_obj, field_name),\nspec=spec,\nuse_refs=use_refs,\n- default_in=default_in)\n+ default_in=default_in,\n+ openapi_major_version=openapi_major_version\n+ )\nif param['in'] == 'body' and body_param is not None:\nbody_param['schema']['properties'].update(param['schema']['properties'])\nrequired_fields = param['schema'].get('required', [])\n@@ -477,7 +484,7 @@ def fields2parameters(fields, schema=None, spec=None, use_refs=True,\nreturn parameters\n-def field2parameter(field, name='body', spec=None, use_refs=True, default_in='body'):\n+def field2parameter(field, name='body', spec=None, use_refs=True, default_in='body', openapi_major_version=2):\n\"\"\"Return an OpenAPI parameter as a `dict`, given a marshmallow\n:class:`Field <marshmallow.Field>`.\n@@ -492,11 +499,12 @@ def field2parameter(field, name='body', spec=None, use_refs=True, default_in='bo\nmultiple=isinstance(field, marshmallow.fields.List),\nlocation=location,\ndefault_in=default_in,\n+ openapi_major_version=openapi_major_version\n)\ndef property2parameter(prop, name='body', required=False, multiple=False, location=None,\n- default_in='body'):\n+ default_in='body', openapi_major_version=2):\n\"\"\"Return the Parameter Object definition for a JSON Schema property.\nhttps://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#parameterObject\n@@ -528,9 +536,15 @@ def property2parameter(prop, name='body', required=False, multiple=False, locati\nret['schema']['required'] = [name]\nelse:\nret['required'] = required\n+ if openapi_major_version == 2:\nif multiple:\nret['collectionFormat'] = 'multi'\nret.update(prop)\n+ elif openapi_major_version == 3:\n+ if multiple:\n+ ret['explode'] = True\n+ ret['style'] = dict(form='array')\n+ ret['schema'] = prop\nreturn ret\n" } ]
Python
MIT License
marshmallow-code/apispec
feat(ext.marshmallow): openapi 3.0 support for parameters
393,999
27.05.2018 23:27:09
-28,800
4b6c63641a6c0c38c1669dff71761a3718c4f11b
test(ext.marshmallow): test schema in docstring expand parameters v3
[ { "change_type": "MODIFY", "old_path": "tests/test_ext_marshmallow.py", "new_path": "tests/test_ext_marshmallow.py", "diff": "@@ -360,6 +360,37 @@ class TestOperationHelper:\nassert post['parameters'] == swagger.schema2parameters(PetSchema, default_in='body', required=True,\nname='pet', description='a pet schema')\n+ def test_schema_in_docstring_expand_parameters_v3(self, spec_3):\n+ def pet_view():\n+ \"\"\"Not much to see here.\n+\n+ ---\n+ get:\n+ parameters:\n+ - in: query\n+ schema: tests.schemas.PetSchema\n+ post:\n+ parameters:\n+ - in: body\n+ description: \"a pet schema\"\n+ required: true\n+ name: pet\n+ schema: tests.schemas.PetSchema\n+ \"\"\"\n+ return '...'\n+\n+ spec_3.add_path(path='/pet', view=pet_view)\n+ p = spec_3._paths['/pet']\n+ assert 'get' in p\n+ get = p['get']\n+ assert 'parameters' in get\n+ assert get['parameters'] == swagger.schema2parameters(PetSchema, default_in='query', spec=spec_3)\n+ post = p['post']\n+ assert 'parameters' in post\n+ post_parameters = swagger.schema2parameters(PetSchema, default_in='body', required=True,\n+ name='pet', description='a pet schema', spec=spec_3)\n+ assert post['parameters'] == post_parameters\n+\ndef test_schema_in_docstring_uses_ref_if_available(self, spec):\nspec.definition('Pet', schema=PetSchema)\n" } ]
Python
MIT License
marshmallow-code/apispec
test(ext.marshmallow): test schema in docstring expand parameters v3
393,999
27.05.2018 23:27:37
-28,800
c3f4b67472cab848d15ba2ff2ff18193a2339280
fix(ext.marshmallow): fix collectionFormat='multi' equivalent
[ { "change_type": "MODIFY", "old_path": "apispec/ext/marshmallow/swagger.py", "new_path": "apispec/ext/marshmallow/swagger.py", "diff": "@@ -543,7 +543,7 @@ def property2parameter(prop, name='body', required=False, multiple=False, locati\nelif openapi_major_version == 3:\nif multiple:\nret['explode'] = True\n- ret['style'] = dict(form='array')\n+ ret['style'] = 'form'\nret['schema'] = prop\nreturn ret\n" } ]
Python
MIT License
marshmallow-code/apispec
fix(ext.marshmallow): fix collectionFormat='multi' equivalent
393,999
01.06.2018 15:02:52
-28,800
ba30476154e16a96619c4a1affb92bd7f711ffb7
fix(ext.marshmallow): fix description for parameters in OpenAPI 3
[ { "change_type": "MODIFY", "old_path": "apispec/ext/marshmallow/swagger.py", "new_path": "apispec/ext/marshmallow/swagger.py", "diff": "@@ -544,6 +544,8 @@ def property2parameter(prop, name='body', required=False, multiple=False, locati\nif multiple:\nret['explode'] = True\nret['style'] = 'form'\n+ if prop.get('description', None):\n+ ret['description'] = prop.pop('description')\nret['schema'] = prop\nreturn ret\n" } ]
Python
MIT License
marshmallow-code/apispec
fix(ext.marshmallow): fix description for parameters in OpenAPI 3
393,999
31.05.2018 23:40:26
-28,800
7c2b2010a7e8146ea5d83e93809b0c4d709461d2
feat(core): deep update components instead of replace components
[ { "change_type": "MODIFY", "old_path": "apispec/core.py", "new_path": "apispec/core.py", "diff": "@@ -156,15 +156,26 @@ class APISpec(object):\nret['swagger'] = self.openapi_version.vstring\nret['definitions'] = self._definitions\nret['parameters'] = self._parameters\n+ ret.update(self.options)\nelif self.openapi_version.version[0] == 3:\nret['openapi'] = self.openapi_version.vstring\n- ret['components'] = {\n- 'schemas': self._definitions,\n- 'parameters': self._parameters,\n- }\n+ options = self.options.copy()\n+ components = options.pop('components', {})\n+\n+ # deep update components object\n+ definitions = components.pop('schemas', {})\n+ definitions.update(self._definitions)\n+ parameters = components.pop('parameters', {})\n+ parameters.update(self._parameters)\n+\n+ ret['components'] = dict(\n+ schemas=definitions,\n+ parameters=parameters,\n+ **components\n+ )\n+ ret.update(options)\n- ret.update(self.options)\nreturn ret\ndef to_yaml(self):\n" } ]
Python
MIT License
marshmallow-code/apispec
feat(core): deep update components instead of replace components
393,999
06.06.2018 22:14:27
-28,800
daf30ef3186c5dbd914d5e8af83000953ddc2c5d
test(schemas): add additional fields in PetSchema for test Deprecated and allowEmptyValue keyword is not supported yet. And the better way maybe is to provide different function of schema2fiels for different version, respectively.
[ { "change_type": "MODIFY", "old_path": "tests/schemas.py", "new_path": "tests/schemas.py", "diff": "@@ -2,8 +2,9 @@ from marshmallow import Schema, fields\nclass PetSchema(Schema):\n- id = fields.Int(dump_only=True)\n- name = fields.Str()\n+ description = dict(id=\"Pet id\", name=\"Pet name\")\n+ id = fields.Int(dump_only=True, description=description['id'])\n+ name = fields.Str(description=description['name'], required=True, deprecated=False, allowEmptyValue=False)\nclass SampleSchema(Schema):\n" } ]
Python
MIT License
marshmallow-code/apispec
test(schemas): add additional fields in PetSchema for test Deprecated and allowEmptyValue keyword is not supported yet. And the better way maybe is to provide different function of schema2fiels for different version, respectively.
393,999
06.06.2018 22:15:52
-28,800
e1f2cbf317befd88c282af05693ac150fbef5242
doc(ext.marshmallow): doc string in field2parameter for OpenAPI 3
[ { "change_type": "MODIFY", "old_path": "apispec/ext/marshmallow/swagger.py", "new_path": "apispec/ext/marshmallow/swagger.py", "diff": "@@ -427,6 +427,13 @@ def fields2parameters(fields, schema=None, spec=None, use_refs=True,\nthe :class:`Schema <marshmallow.Schema>`.\nhttps://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#parameterObject\n+\n+ For OpenAPI 3, only \"query\", \"header\", \"path\" or \"cookie\" is allowed for the location\n+ of parameters. In OpenAPI 3, Request Body Object is used when parameters is in body.\n+ So this function always return an array of a parameter for each included field in\n+ the :class:`Schema <marshmallow.Schema>`.\n+\n+ https://swagger.io/specification/#parameterObject\n\"\"\"\nswagger_default_in = __location_map__.get(default_in, default_in)\nif spec is None:\n@@ -434,7 +441,7 @@ def fields2parameters(fields, schema=None, spec=None, use_refs=True,\nelse:\nopenapi_major_version = spec.openapi_version.version[0]\n- if swagger_default_in == 'body':\n+ if openapi_major_version == 2 and swagger_default_in == 'body':\nif schema is not None:\n# Prevent circular import\nfrom apispec.ext.marshmallow import resolve_schema_dict\n@@ -472,6 +479,7 @@ def fields2parameters(fields, schema=None, spec=None, use_refs=True,\ndefault_in=default_in,\nopenapi_major_version=openapi_major_version\n)\n+ if openapi_major_version == 2:\nif param['in'] == 'body' and body_param is not None:\nbody_param['schema']['properties'].update(param['schema']['properties'])\nrequired_fields = param['schema'].get('required', [])\n" } ]
Python
MIT License
marshmallow-code/apispec
doc(ext.marshmallow): doc string in field2parameter for OpenAPI 3
393,999
06.06.2018 22:17:43
-28,800
1e1e93d4bf710cff346962ac4707382e10032974
test(marshmallow): description for parameters and test for requestBody
[ { "change_type": "MODIFY", "old_path": "tests/test_ext_marshmallow.py", "new_path": "tests/test_ext_marshmallow.py", "diff": "@@ -6,7 +6,7 @@ from marshmallow.fields import Field, DateTime, Dict, String\nfrom marshmallow import Schema\nfrom apispec import APISpec\n-from apispec.ext.marshmallow import swagger\n+from apispec.ext.marshmallow import swagger, resolve_schema_dict\nfrom .schemas import PetSchema, AnalysisSchema, SampleSchema, RunSchema, \\\nSelfReferencingSchema, OrderedSchema, PatternedObjectSchema, \\\nDefaultCallableSchema, AnalysisWithListSchema\n@@ -369,27 +369,42 @@ class TestOperationHelper:\nparameters:\n- in: query\nschema: tests.schemas.PetSchema\n+ responses:\n+ 201:\n+ description: successful operation\npost:\n- parameters:\n- - in: body\n+ requestBody:\ndescription: \"a pet schema\"\nrequired: true\n- name: pet\n+ content:\n+ application/json:\nschema: tests.schemas.PetSchema\n+ responses:\n+ 201:\n+ description: successful operation\n\"\"\"\nreturn '...'\nspec_3.add_path(path='/pet', view=pet_view)\np = spec_3._paths['/pet']\n+\nassert 'get' in p\nget = p['get']\nassert 'parameters' in get\nassert get['parameters'] == swagger.schema2parameters(PetSchema, default_in='query', spec=spec_3)\n+ for parameter in get['parameters']:\n+ description = parameter.get('description', False)\n+ assert description\n+ name = parameter['name']\n+ assert description == PetSchema.description[name]\n+\n+ assert 'post' in p\npost = p['post']\n- assert 'parameters' in post\n- post_parameters = swagger.schema2parameters(PetSchema, default_in='body', required=True,\n- name='pet', description='a pet schema', spec=spec_3)\n- assert post['parameters'] == post_parameters\n+ assert 'requestBody' in post\n+ post_schema = resolve_schema_dict(spec_3, PetSchema)\n+ assert post['requestBody']['content']['application/json']['schema'] == post_schema\n+ assert post['requestBody']['description'] == 'a pet schema'\n+ assert post['requestBody']['required']\ndef test_schema_in_docstring_uses_ref_if_available(self, spec):\nspec.definition('Pet', schema=PetSchema)\n" } ]
Python
MIT License
marshmallow-code/apispec
test(marshmallow): description for parameters and test for requestBody
393,999
06.06.2018 22:21:47
-28,800
1db29fe3a3840343a6031652cc8f30d93534bb13
refactor(test): fix style
[ { "change_type": "MODIFY", "old_path": "tests/schemas.py", "new_path": "tests/schemas.py", "diff": "@@ -2,7 +2,7 @@ from marshmallow import Schema, fields\nclass PetSchema(Schema):\n- description = dict(id=\"Pet id\", name=\"Pet name\")\n+ description = dict(id='Pet id', name='Pet name')\nid = fields.Int(dump_only=True, description=description['id'])\nname = fields.Str(description=description['name'], required=True, deprecated=False, allowEmptyValue=False)\n" } ]
Python
MIT License
marshmallow-code/apispec
refactor(test): fix style
393,999
06.06.2018 23:39:44
-28,800
a6a9976c77ebf736f9446f9898421decf820f825
test(core): deep update top-level components object for OpenAPI 3
[ { "change_type": "MODIFY", "old_path": "tests/test_core.py", "new_path": "tests/test_core.py", "diff": "@@ -26,11 +26,28 @@ def spec():\[email protected]()\ndef spec_3():\n+ components = {\n+ 'securitySchemes': {\n+ 'bearerAuth':\n+ dict(type='http', scheme='bearer', bearerFormat='JWT')\n+ },\n+ 'schemas': {\n+ 'ErrorResponse': {\n+ 'type': 'object',\n+ 'properties': {\n+ 'ok': {\n+ 'type': 'boolean', 'description': 'status indicator', 'example': False\n+ }\n+ },\n+ 'required': ['ok']\n+ }\n+ }\n+ }\nreturn APISpec(\ntitle='Swagger Petstore',\nversion='1.0.0',\ninfo={'description': description},\n- security=[{'apiKey': []}],\n+ components=components,\nopenapi_version='3.0.0'\n)\n@@ -64,6 +81,26 @@ class TestMetadata:\nassert metadata['info']['version'] == '1.0.0'\nassert metadata['info']['description'] == description\n+ def test_swagger_metadata_v3(self, spec_3):\n+ metadata = spec_3.to_dict()\n+ security_schemes = {'bearerAuth': dict(type='http', scheme='bearer', bearerFormat='JWT')}\n+ assert metadata['components']['securitySchemes'] == security_schemes\n+ assert metadata['components']['schemas'].get('ErrorResponse', False)\n+ assert metadata['info']['title'] == 'Swagger Petstore'\n+ assert metadata['info']['version'] == '1.0.0'\n+ assert metadata['info']['description'] == description\n+\n+ def test_swagger_metadata_merge_v3(self, spec_3):\n+ properties = {\n+ 'ok': {\n+ 'type': 'boolean', 'description': 'property description', 'example': True\n+ }\n+ }\n+ spec_3.definition('definition', properties=properties, description='definiton description')\n+ metadata = spec_3.to_dict()\n+ assert metadata['components']['schemas'].get('ErrorResponse', False)\n+ assert metadata['components']['schemas'].get('definition', False)\n+\nclass TestTags:\n" } ]
Python
MIT License
marshmallow-code/apispec
test(core): deep update top-level components object for OpenAPI 3
393,985
05.09.2018 17:12:47
14,400
56fe1c66d917490f86b1feec8b7b7934853c0e4c
Use yaml.safe_load() instead of load() load() has known security issues:
[ { "change_type": "MODIFY", "old_path": "AUTHORS.rst", "new_path": "AUTHORS.rst", "diff": "@@ -51,3 +51,4 @@ Contributors (chronological)\n- Christina Long `@cvlong <https://github.com/cvlong>`_\n- Felix Yan `@felixonmars <https://github.com/felixonmars>`_\n- Guoli Lyu `@Guoli-Lyu <https://github.com/Guoli-Lyu>`_\n+- Laura Beaufort `@lbeaufort <https://github.com/lbeaufort>`_\n" }, { "change_type": "MODIFY", "old_path": "apispec/yaml_utils.py", "new_path": "apispec/yaml_utils.py", "diff": "@@ -46,7 +46,7 @@ def load_yaml_from_docstring(docstring):\nyaml_string = '\\n'.join(split_lines[cut_from:])\nyaml_string = dedent(yaml_string)\n- return yaml.load(yaml_string) or {}\n+ return yaml.safe_load(yaml_string) or {}\nPATH_KEYS = set([\n" }, { "change_type": "MODIFY", "old_path": "docs/special_topics.rst", "new_path": "docs/special_topics.rst", "diff": "@@ -87,7 +87,7 @@ Here is an example that includes a `Security Scheme Object <https://github.com/O\nbearerFormat: JWT\n\"\"\"\n- settings = yaml.load(OPENAPI_SPEC)\n+ settings = yaml.safe_load(OPENAPI_SPEC)\n# retrieve title, version, and openapi version\ntitle = settings['info'].pop('title')\nspec_version = settings['info'].pop('version')\n" }, { "change_type": "MODIFY", "old_path": "tests/test_core.py", "new_path": "tests/test_core.py", "diff": "@@ -163,7 +163,7 @@ class TestDefinitions:\nproperties=self.properties,\nenum=enum,\n)\n- assert spec.to_dict() == yaml.load(spec.to_yaml())\n+ assert spec.to_dict() == yaml.safe_load(spec.to_yaml())\nclass TestPath:\npaths = {\n" } ]
Python
MIT License
marshmallow-code/apispec
Use yaml.safe_load() instead of load() load() has known security issues: https://github.com/yaml/pyyaml/pull/189
393,992
29.11.2018 14:39:55
-3,600
98a9c402a8208e95c86c340e49281049dda1b3c9
Call resolve_schema_cls throught OpenAPIConverter
[ { "change_type": "MODIFY", "old_path": "apispec/ext/marshmallow/__init__.py", "new_path": "apispec/ext/marshmallow/__init__.py", "diff": "@@ -74,11 +74,11 @@ class MarshmallowPlugin(BasePlugin):\nnested_schema_class = None\nif isinstance(field, marshmallow.fields.Nested):\n- nested_schema_class = resolve_schema_cls(field.schema)\n+ nested_schema_class = self.openapi.resolve_schema_class(field.schema)\nelif isinstance(field, marshmallow.fields.List) \\\nand isinstance(field.container, marshmallow.fields.Nested):\n- nested_schema_class = resolve_schema_cls(field.container.schema)\n+ nested_schema_class = self.openapi.resolve_schema_class(field.container.schema)\nif nested_schema_class and nested_schema_class not in self.openapi.refs:\ndefinition_name = self.schema_name_resolver(\n" }, { "change_type": "MODIFY", "old_path": "apispec/ext/marshmallow/openapi.py", "new_path": "apispec/ext/marshmallow/openapi.py", "diff": "@@ -660,7 +660,7 @@ class OpenAPIConverter(object):\nif isinstance(schema, marshmallow.Schema) and use_instances:\nschema_cls = schema\nelse:\n- schema_cls = resolve_schema_cls(schema)\n+ schema_cls = self.resolve_schema_class(schema)\nif schema_cls in self.refs:\nref_path = self.get_ref_path()\n@@ -674,3 +674,11 @@ class OpenAPIConverter(object):\nif not isinstance(schema, marshmallow.Schema):\nschema = schema_cls\nreturn self.schema2jsonschema(schema, dump=dump, load=load)\n+\n+ def resolve_schema_class(self, schema):\n+ \"\"\"Return schema class for given schema (instance or class)\n+\n+ :param type|Schema|str: instance, class or class name of marshmallow.Schema\n+ :return: schema class of given schema (instance or class)\n+ \"\"\"\n+ return resolve_schema_cls(schema)\n" } ]
Python
MIT License
marshmallow-code/apispec
Call resolve_schema_cls throught OpenAPIConverter
394,000
23.11.2018 19:27:56
18,000
e74f2239b69db9dc6650a15fe8acd257630c71ec
removes use_instances from function signature because it doesn't do anything anymore
[ { "change_type": "MODIFY", "old_path": "apispec/ext/marshmallow/openapi.py", "new_path": "apispec/ext/marshmallow/openapi.py", "diff": "@@ -436,7 +436,7 @@ class OpenAPIConverter(object):\ndef fields2parameters(\nself, fields, schema=None, use_refs=True,\ndefault_in='body', name='body', required=False,\n- use_instances=False, description=None, **kwargs\n+ description=None, **kwargs\n):\n\"\"\"Return an array of OpenAPI parameters given a mapping between field names and\n:class:`Field <marshmallow.Field>` objects. If `default_in` is \"body\", then return an array\n@@ -456,7 +456,7 @@ class OpenAPIConverter(object):\nopenapi_default_in = __location_map__.get(default_in, default_in)\nif self.openapi_version.major < 3 and openapi_default_in == 'body':\nif schema is not None:\n- prop = self.resolve_schema_dict(schema, use_instances=use_instances)\n+ prop = self.resolve_schema_dict(schema)\nelse:\nprop = self.fields2jsonschema(fields, use_refs=use_refs)\n@@ -683,15 +683,13 @@ class OpenAPIConverter(object):\n}\nreturn ref_paths[self.openapi_version.major]\n- def resolve_schema_dict(self, schema, use_instances=False):\n+ def resolve_schema_dict(self, schema):\nif isinstance(schema, dict):\nif schema.get('type') == 'array' and 'items' in schema:\n- schema['items'] = self.resolve_schema_dict(\n- schema['items'], use_instances=use_instances,\n- )\n+ schema['items'] = self.resolve_schema_dict(schema['items'])\nif schema.get('type') == 'object' and 'properties' in schema:\nschema['properties'] = {\n- k: self.resolve_schema_dict(v, use_instances=use_instances)\n+ k: self.resolve_schema_dict(v)\nfor k, v in schema['properties'].items()\n}\nreturn schema\n" } ]
Python
MIT License
marshmallow-code/apispec
removes use_instances from function signature because it doesn't do anything anymore
394,000
04.12.2018 15:58:41
18,000
dc2dc81c942ca7b2a3db28e47bb46833bb7d7d0c
resolve name clashes by creating a unique name and warning the user
[ { "change_type": "MODIFY", "old_path": "apispec/ext/marshmallow/common.py", "new_path": "apispec/ext/marshmallow/common.py", "diff": "\"\"\"Utilities to get schema instances/classes\"\"\"\nimport copy\n+import warnings\nfrom collections import namedtuple\nimport marshmallow\n@@ -60,3 +61,28 @@ def make_schema_key(schema):\nSchemaKey = namedtuple('SchemaKey', ['SchemaClass'] + MODIFIERS)\n+\n+\n+def get_unique_schema_name(components, name, counter=0):\n+ \"\"\"Function to generate a unique name based on the provided name and names\n+ already in the spec. Will append a number to the name to make it unique if\n+ the name is already in the spec.\n+\n+ :param Components components: instance of the components of the spec\n+ :param string name: the name to use as a basis for the unique name\n+ :param int counter: the counter of the number of recursions\n+ :return: the unique name\n+ \"\"\"\n+ if name not in components._schemas:\n+ return name\n+ if not counter: # first time time through recursion\n+ warnings.warn(\n+ 'Multiple schemas resolved to the name {} - name has been modified '\n+ 'either manually add each of the schemas with a different name or '\n+ 'provide custom schema_name_resolver'.format(name),\n+ UserWarning,\n+ )\n+ else: # subsequent recursions\n+ name = name[:-len(str(counter))]\n+ counter += 1\n+ return get_unique_schema_name(components, name + str(counter), counter)\n" }, { "change_type": "MODIFY", "old_path": "apispec/ext/marshmallow/openapi.py", "new_path": "apispec/ext/marshmallow/openapi.py", "diff": "@@ -18,6 +18,7 @@ from marshmallow.orderedset import OrderedSet\nfrom apispec.utils import OpenAPIVersion\nfrom .common import (\nresolve_schema_cls, get_fields, make_schema_key, resolve_schema_instance,\n+ get_unique_schema_name,\n)\nfrom apispec.exceptions import APISpecError\n@@ -421,6 +422,7 @@ class OpenAPIConverter(object):\nschema_instance = resolve_schema_instance(schema)\nschema_key = make_schema_key(schema_instance)\nif schema_key not in self.refs:\n+ name = get_unique_schema_name(self.spec.components, name)\nself.spec.components.schema(\nname,\nschema=schema,\n" }, { "change_type": "MODIFY", "old_path": "tests/test_ext_marshmallow.py", "new_path": "tests/test_ext_marshmallow.py", "diff": "@@ -153,6 +153,21 @@ class TestDefinitionHelper:\npet_exclude = definitions['MultiModifierSchema']['properties']['pet_exclude']\nassert pet_exclude == {'$ref': ref_path(spec) + 'Pet_Exclude'}\n+ def test_schema_with_clashing_names(self, spec):\n+ class Pet(PetSchema):\n+ another_field = String()\n+\n+ class NameClashSchema(Schema):\n+ pet_1 = Nested(PetSchema)\n+ pet_2 = Nested(Pet)\n+\n+ with pytest.warns(UserWarning, match='Multiple schemas resolved to the name Pet'):\n+ spec.components.schema('NameClashSchema', schema=NameClashSchema)\n+\n+ definitions = get_definitions(spec)\n+\n+ assert 'Pet' in definitions\n+ assert 'Pet1' in definitions\nclass TestComponentParameterHelper:\n" }, { "change_type": "MODIFY", "old_path": "tests/test_ext_marshmallow_common.py", "new_path": "tests/test_ext_marshmallow_common.py", "diff": "# -*- coding: utf-8 -*-\nimport pytest\n-from apispec.ext.marshmallow.common import make_schema_key\n+from apispec.ext.marshmallow.common import make_schema_key, get_unique_schema_name\nfrom .schemas import PetSchema, SampleSchema\n@@ -18,3 +18,24 @@ class TestMakeSchemaKey:\ndef test_instances_with_different_modifiers_not_equal(self):\nassert make_schema_key(PetSchema()) != make_schema_key(PetSchema(partial=True))\n+\n+\n+class TestUniqueName:\n+ def test_unique_name(self, spec):\n+ properties = {\n+ 'id': {'type': 'integer', 'format': 'int64'},\n+ 'name': {'type': 'string', 'example': 'doggie'},\n+ }\n+\n+ name = get_unique_schema_name(spec.components, 'Pet')\n+ assert name == 'Pet'\n+\n+ spec.components.schema('Pet', properties=properties)\n+ with pytest.warns(UserWarning, match='Multiple schemas resolved to the name Pet'):\n+ name_1 = get_unique_schema_name(spec.components, 'Pet')\n+ assert name_1 == 'Pet1'\n+\n+ spec.components.schema('Pet1', properties=properties)\n+ with pytest.warns(UserWarning, match='Multiple schemas resolved to the name Pet'):\n+ name_2 = get_unique_schema_name(spec.components, 'Pet')\n+ assert name_2 == 'Pet2'\n" } ]
Python
MIT License
marshmallow-code/apispec
resolve name clashes by creating a unique name and warning the user
394,000
31.12.2018 17:26:32
18,000
6747cd06d29f294ffbefbdc21f38ad27a1bf6f98
update docs to include new behavior relating to schema modifiers and nested fields
[ { "change_type": "MODIFY", "old_path": "docs/using_plugins.rst", "new_path": "docs/using_plugins.rst", "diff": "@@ -197,6 +197,45 @@ If your API uses `method-based dispatching <http://flask.pocoo.org/docs/0.12/vie\n# 'post': {}}}\n#\n+\n+Marshmallow Plugin\n+------------------\n+\n+Nesting Schemas\n+***************\n+\n+By default, Marshmallow `Nested` fields are represented by a `JSON Reference object\n+<https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#referenceObject>`_.\n+If the schema has been added to the spec via `spec.components.schema <apispec.core.Components.schema>`,\n+the user-supplied name will be used in the reference. Otherwise apispec will\n+add the nested schema to the spec using an automatically resolved name for the\n+nested schema. The default `schema_name_resolver <apispec.ext.marshmallow.resolver>`\n+function will resolve a name based on the schema's class `__name__`, dropping a\n+trailing \"Schema\" so that `class PetSchema(Schema)` resolves to \"Pet\".\n+\n+To change the behavior of the name resolution simply pass an alternative\n+function accepting a `Schema` class and returning a string to the plugin's\n+constructor. If the `schema_name_resolver` function returns a value that\n+evaluates to `False` in a boolean context the nested schema will not be added to\n+the spec and instead defined in-line.\n+\n+Note: Circular-referencing schemas cannot be defined in-line due to infinite\n+recursion so a `schema_name_resolver` function must return a string name when\n+working with circular-referencing schemas.\n+\n+Schema Modifiers\n+****************\n+\n+`Schema` instances can be initialized with modifier parameters to exclude\n+fields or ignore the absence of required fields. apispec will respect\n+schema modifiers in the generated schema definition. If a particular schema is\n+initialized in an application with modifiers, it may be added to the spec with\n+each set of modifiers and apispec will treat each unique set of modifiers --\n+including no modifiers - as a unique schema definition.\n+\n+Custom Fields\n+***************\n+\nBy default, apispec only knows how to set the type of\nbuilt-in marshmallow fields. If you want to generate definitions for\nschemas with custom fields, use the\n" } ]
Python
MIT License
marshmallow-code/apispec
update docs to include new behavior relating to schema modifiers and nested fields
394,000
02.01.2019 22:23:53
18,000
fae9f362ac085611fd2f382128b5f8f4bd296097
fix issue with invalid reference object per OpenAPI reference objects cannot have any additional properties fix
[ { "change_type": "MODIFY", "old_path": "tests/test_openapi.py", "new_path": "tests/test_openapi.py", "diff": "@@ -574,11 +574,17 @@ class TestNesting:\ndef test_field2property_nested_spec_metadatas(self, spec_fixture):\nspec_fixture.spec.components.schema('Category', schema=CategorySchema)\n- category = fields.Nested(CategorySchema, description='A category')\n+ category = fields.Nested(\n+ CategorySchema,\n+ description='A category',\n+ invalid_property='not in the result',\n+ x_extension='A great extension',\n+ )\nresult = spec_fixture.openapi.field2property(category)\nassert result == {\n- '$ref': ref_path(spec_fixture.spec) + 'Category',\n+ 'allOf': [{'$ref': ref_path(spec_fixture.spec) + 'Category'}],\n'description': 'A category',\n+ 'x-extension': 'A great extension',\n}\ndef test_field2property_nested_spec(self, spec_fixture):\n@@ -599,11 +605,6 @@ class TestNesting:\ncat_with_ref = fields.Nested(CategorySchema, ref='Category')\nassert openapi.field2property(cat_with_ref) == {'$ref': 'Category'}\n- def test_field2property_nested_ref_with_meta(self, openapi):\n- cat_with_ref = fields.Nested(CategorySchema, ref='Category', description='A category')\n- result = openapi.field2property(cat_with_ref)\n- assert result == {'$ref': 'Category', 'description': 'A category'}\n-\ndef test_field2property_nested_many(self, spec_fixture):\ncategories = fields.Nested(CategorySchema, many=True)\nres = spec_fixture.openapi.field2property(categories)\n" } ]
Python
MIT License
marshmallow-code/apispec
fix issue with invalid reference object per OpenAPI reference objects cannot have any additional properties fix #347
394,000
02.01.2019 22:39:02
18,000
cd8fa8f3f16e21a68e077ebcac9f0ef16f32b0c1
extract method for generating type and format
[ { "change_type": "MODIFY", "old_path": "apispec/ext/marshmallow/openapi.py", "new_path": "apispec/ext/marshmallow/openapi.py", "diff": "@@ -148,6 +148,24 @@ class OpenAPIConverter(object):\nreturn inner\n+ def field2type_and_format(self, field):\n+ \"\"\"Return the dictionary of OpenAPI type and format based on the field\n+ type\n+\n+ :param Field field: A marshmallow field.\n+ :rtype: dict\n+ \"\"\"\n+ type_, fmt = self.field_mapping.get(type(field), ('string', None))\n+\n+ ret = {\n+ 'type': type_,\n+ }\n+\n+ if fmt:\n+ ret['format'] = fmt\n+\n+ return ret\n+\ndef field2choices(self, field, **kwargs):\n\"\"\"Return the dictionary of OpenAPI field attributes for valid choices definition\n@@ -336,16 +354,7 @@ class OpenAPIConverter(object):\n:param str name: The definition name, if applicable, used to construct the $ref value.\n:rtype: dict, a Property Object\n\"\"\"\n-\n- type_, fmt = self.field_mapping.get(type(field), ('string', None))\n-\n- ret = {\n- 'type': type_,\n- }\n-\n- if fmt:\n- ret['format'] = fmt\n-\n+ ret = {}\nif 'doc_default' in field.metadata:\nret['default'] = field.metadata['doc_default']\nelse:\n@@ -354,6 +363,7 @@ class OpenAPIConverter(object):\nret['default'] = default\nfor attr_func in (\n+ self.field2type_and_format,\nself.field2choices,\nself.field2read_only,\nself.field2write_only,\n" } ]
Python
MIT License
marshmallow-code/apispec
extract method for generating type and format
394,000
02.01.2019 23:17:52
18,000
4864b1e94999a8cef05e13515c071271e36401d8
extract method for generating default
[ { "change_type": "MODIFY", "old_path": "apispec/ext/marshmallow/openapi.py", "new_path": "apispec/ext/marshmallow/openapi.py", "diff": "@@ -166,6 +166,26 @@ class OpenAPIConverter(object):\nreturn ret\n+ def field2default(self, field):\n+ \"\"\"Return the dictionary containing the field's default value\n+\n+ Will first look for a `doc_default` key in the field's metadata and then\n+ fall back on the field's `missing` parameter. A callable passed to the\n+ field's missing parameter will be ignored.\n+\n+ :param Field field: A marshmallow field.\n+ :rtype: dict\n+ \"\"\"\n+ ret = {}\n+ if 'doc_default' in field.metadata:\n+ ret['default'] = field.metadata['doc_default']\n+ else:\n+ default = field.missing\n+ if default is not marshmallow.missing and not callable(default):\n+ ret['default'] = default\n+\n+ return ret\n+\ndef field2choices(self, field, **kwargs):\n\"\"\"Return the dictionary of OpenAPI field attributes for valid choices definition\n@@ -355,15 +375,10 @@ class OpenAPIConverter(object):\n:rtype: dict, a Property Object\n\"\"\"\nret = {}\n- if 'doc_default' in field.metadata:\n- ret['default'] = field.metadata['doc_default']\n- else:\n- default = field.missing\n- if default is not marshmallow.missing and not callable(default):\n- ret['default'] = default\nfor attr_func in (\nself.field2type_and_format,\n+ self.field2default,\nself.field2choices,\nself.field2read_only,\nself.field2write_only,\n" } ]
Python
MIT License
marshmallow-code/apispec
extract method for generating default
394,000
26.11.2018 13:02:12
18,000
18529ee7c947ee19c2ccb46671ebf3fc7da0b627
redistribute logic between schema2jsonschema and field2jsonschema
[ { "change_type": "MODIFY", "old_path": "apispec/ext/marshmallow/common.py", "new_path": "apispec/ext/marshmallow/common.py", "diff": "import copy\nimport warnings\n-from collections import namedtuple\n+from collections import namedtuple, OrderedDict\nimport marshmallow\n@@ -40,11 +40,36 @@ def resolve_schema_cls(schema):\ndef get_fields(schema):\n\"\"\"Return fields from schema\"\"\"\nif hasattr(schema, 'fields'):\n- return schema.fields\n+ fields = schema.fields\nelif hasattr(schema, '_declared_fields'):\n- return copy.deepcopy(schema._declared_fields)\n+ fields = copy.deepcopy(schema._declared_fields)\n+ else:\nraise ValueError(\"{0!r} doesn't have either `fields` or `_declared_fields`.\".format(schema))\n+ return filter_excluded_fields(fields, schema)\n+\n+\n+def filter_excluded_fields(fields, schema):\n+ Meta = getattr(schema, 'Meta', None)\n+ if getattr(Meta, 'fields', None) or getattr(Meta, 'additional', None):\n+ declared_fields = set(schema._declared_fields.keys())\n+ if (\n+ set(getattr(Meta, 'fields', set())) > declared_fields or\n+ set(getattr(Meta, 'additional', set())) > declared_fields\n+ ):\n+ warnings.warn(\n+ 'Only explicitly-declared fields will be included in the Schema Object. '\n+ 'Fields defined in Meta.fields or Meta.additional are ignored.',\n+ )\n+\n+ exclude = getattr(Meta, 'exclude', [])\n+\n+ filtered_fields = OrderedDict(\n+ (key, value) for key, value in fields.items() if key not in exclude\n+ )\n+\n+ return filtered_fields\n+\ndef make_schema_key(schema):\nif not isinstance(schema, marshmallow.Schema):\n" }, { "change_type": "MODIFY", "old_path": "apispec/ext/marshmallow/openapi.py", "new_path": "apispec/ext/marshmallow/openapi.py", "diff": "@@ -6,7 +6,6 @@ OpenAPI 2.0 spec: https://github.com/OAI/OpenAPI-Specification/blob/master/versi\n\"\"\"\nfrom __future__ import absolute_import, unicode_literals\nimport operator\n-import warnings\nimport functools\nfrom collections import OrderedDict\n@@ -522,13 +521,12 @@ class OpenAPIConverter(object):\nassert not getattr(schema, 'many', False), \\\n\"Schemas with many=True are only supported for 'json' location (aka 'in: body')\"\n- exclude_fields = getattr(getattr(schema, 'Meta', None), 'exclude', [])\ndump_only_fields = getattr(getattr(schema, 'Meta', None), 'dump_only', [])\nparameters = []\nbody_param = None\nfor field_name, field_obj in iteritems(fields):\n- if (field_name in exclude_fields or field_obj.dump_only or field_name in dump_only_fields):\n+ if (field_obj.dump_only or field_name in dump_only_fields):\ncontinue\nparam = self.field2parameter(\nfield_obj,\n@@ -613,9 +611,6 @@ class OpenAPIConverter(object):\nreturn ret\ndef schema2jsonschema(self, schema, **kwargs):\n- return self.fields2jsonschema(get_fields(schema), schema, **kwargs)\n-\n- def fields2jsonschema(self, fields, schema=None, use_refs=True, name=None):\n\"\"\"Return the JSON Schema Object for a given marshmallow\n:class:`Schema <marshmallow.Schema>`. Schema may optionally provide the ``title`` and\n``description`` class Meta options.\n@@ -654,36 +649,49 @@ class OpenAPIConverter(object):\n:param Schema schema: A marshmallow Schema instance or a class object\n:rtype: dict, a JSON Schema Object\n\"\"\"\n+ fields = get_fields(schema)\nMeta = getattr(schema, 'Meta', None)\n- if getattr(Meta, 'fields', None) or getattr(Meta, 'additional', None):\n- declared_fields = set(schema._declared_fields.keys())\n- if (\n- set(getattr(Meta, 'fields', set())) > declared_fields or\n- set(getattr(Meta, 'additional', set())) > declared_fields\n- ):\n- warnings.warn(\n- 'Only explicitly-declared fields will be included in the Schema Object. '\n- 'Fields defined in Meta.fields or Meta.additional are ignored.',\n- )\n+ partial = getattr(schema, 'partial', None)\n+ ordered = getattr(schema, 'ordered', False)\n+ jsonschema = self.fields2jsonschema(fields, partial=partial, ordered=ordered, **kwargs)\n+\n+ if hasattr(Meta, 'title'):\n+ jsonschema['title'] = Meta.title\n+ if hasattr(Meta, 'description'):\n+ jsonschema['description'] = Meta.description\n+\n+ if getattr(schema, 'many', False):\njsonschema = {\n- 'type': 'object',\n- 'properties': OrderedDict() if getattr(Meta, 'ordered', None) else {},\n+ 'type': 'array',\n+ 'items': jsonschema,\n}\n- exclude = set(getattr(Meta, 'exclude', []))\n+ return jsonschema\n- for field_name, field_obj in iteritems(fields):\n- if (field_name in exclude):\n- continue\n+ def fields2jsonschema(self, fields, ordered=False, partial=None, use_refs=True, name=None):\n+ \"\"\"Return the JSON Schema Object given a mapping between field names and\n+ :class:`Field <marshmallow.Field>` objects.\n+ :param dict fields: A dictionary of field name field object pairs\n+ :param bool ordered: Whether to preserve the order in which fields were declared\n+ :param bool|tuple partial: Whether to override a field's required flag.\n+ If `True` no fields will be set as required. If an iterable fields\n+ in the iterable will not be marked as required.\n+ :rtype: dict, a JSON Schema Object\n+ \"\"\"\n+ jsonschema = {\n+ 'type': 'object',\n+ 'properties': OrderedDict() if ordered else {},\n+ }\n+\n+ for field_name, field_obj in iteritems(fields):\nobserved_field_name = self._observed_name(field_obj, field_name)\nproperty = self.field2property(\nfield_obj, use_refs=use_refs, name=name,\n)\njsonschema['properties'][observed_field_name] = property\n- partial = getattr(schema, 'partial', None)\nif field_obj.required:\nif not partial or (is_collection(partial) and field_name not in partial):\njsonschema.setdefault('required', []).append(observed_field_name)\n@@ -691,18 +699,6 @@ class OpenAPIConverter(object):\nif 'required' in jsonschema:\njsonschema['required'].sort()\n- if Meta is not None:\n- if hasattr(Meta, 'title'):\n- jsonschema['title'] = Meta.title\n- if hasattr(Meta, 'description'):\n- jsonschema['description'] = Meta.description\n-\n- if getattr(schema, 'many', False):\n- jsonschema = {\n- 'type': 'array',\n- 'items': jsonschema,\n- }\n-\nreturn jsonschema\ndef get_ref_dict(self, schema):\n" } ]
Python
MIT License
marshmallow-code/apispec
redistribute logic between schema2jsonschema and field2jsonschema
394,000
26.11.2018 16:01:39
18,000
588f799c1c5851cae6bb9f30216eb47a2abaf388
redistribute logic between schema2paramaters and fields2parameters
[ { "change_type": "MODIFY", "old_path": "apispec/ext/marshmallow/common.py", "new_path": "apispec/ext/marshmallow/common.py", "diff": "@@ -21,7 +21,13 @@ def resolve_schema_instance(schema):\nreturn schema()\nif isinstance(schema, marshmallow.Schema):\nreturn schema\n+ try:\nreturn marshmallow.class_registry.get_class(schema)()\n+ except marshmallow.exceptions.RegistryError:\n+ raise ValueError(\n+ '{!r} is not a marshmallow.Schema subclass or instance and has not'\n+ ' been registered in the Marshmallow class registry.'.format(schema),\n+ )\ndef resolve_schema_cls(schema):\n@@ -34,25 +40,42 @@ def resolve_schema_cls(schema):\nreturn schema\nif isinstance(schema, marshmallow.Schema):\nreturn type(schema)\n+ try:\nreturn marshmallow.class_registry.get_class(schema)\n+ except marshmallow.exceptions.RegistryError:\n+ raise ValueError(\n+ '{!r} is not a marshmallow.Schema subclass or instance and has not'\n+ ' been registered in the Marshmallow class registry.'.format(schema),\n+ )\n+\n+def get_fields(schema, exclude_dump_only=False):\n+ \"\"\"Return fields from schema\n-def get_fields(schema):\n- \"\"\"Return fields from schema\"\"\"\n+ :param Schema schema: A marshmallow Schema instance or a class object\n+ :param bool exclude_dump_only: whether to filter fields in Meta.dump_only\n+ :rtype: dict, of field name field object pairs\n+ \"\"\"\nif hasattr(schema, 'fields'):\nfields = schema.fields\nelif hasattr(schema, '_declared_fields'):\nfields = copy.deepcopy(schema._declared_fields)\nelse:\n- raise ValueError(\"{0!r} doesn't have either `fields` or `_declared_fields`.\".format(schema))\n+ raise ValueError(\"{!r} doesn't have either `fields` or `_declared_fields`.\".format(schema))\n+ Meta = getattr(schema, 'Meta', None)\n+ warn_if_fields_defined_in_meta(fields, Meta)\n+ return filter_excluded_fields(fields, Meta, exclude_dump_only)\n- return filter_excluded_fields(fields, schema)\n+def warn_if_fields_defined_in_meta(fields, Meta):\n+ \"\"\"Warns user that fields defined in Meta.fields or Meta.additional will\n+ be ignored\n-def filter_excluded_fields(fields, schema):\n- Meta = getattr(schema, 'Meta', None)\n+ :param dict fields: A dictionary of of fields name field object pairs\n+ :param Meta: the schema's Meta class\n+ \"\"\"\nif getattr(Meta, 'fields', None) or getattr(Meta, 'additional', None):\n- declared_fields = set(schema._declared_fields.keys())\n+ declared_fields = set(fields.keys())\nif (\nset(getattr(Meta, 'fields', set())) > declared_fields or\nset(getattr(Meta, 'additional', set())) > declared_fields\n@@ -62,7 +85,17 @@ def filter_excluded_fields(fields, schema):\n'Fields defined in Meta.fields or Meta.additional are ignored.',\n)\n+\n+def filter_excluded_fields(fields, Meta, exclude_dump_only):\n+ \"\"\"Filter fields that should be ignored in the OpenAPI spec\n+\n+ :param dict fields: A dictionary of of fields name field object pairs\n+ :param Meta: the schema's Meta class\n+ :param bool exclude_dump_only: whether to filter fields in Meta.dump_only\n+ \"\"\"\nexclude = getattr(Meta, 'exclude', [])\n+ if exclude_dump_only:\n+ exclude += getattr(Meta, 'dump_only', [])\nfiltered_fields = OrderedDict(\n(key, value) for key, value in fields.items() if key not in exclude\n" }, { "change_type": "MODIFY", "old_path": "apispec/ext/marshmallow/openapi.py", "new_path": "apispec/ext/marshmallow/openapi.py", "diff": "@@ -469,7 +469,9 @@ class OpenAPIConverter(object):\n)\nreturn self.get_ref_dict(schema_instance)\n- def schema2parameters(self, schema, **kwargs):\n+ def schema2parameters(\n+ self, schema, default_in='body', name='body', required=False, description=None,\n+ ):\n\"\"\"Return an array of OpenAPI parameters given a given marshmallow\n:class:`Schema <marshmallow.Schema>`. If `default_in` is \"body\", then return an array\nof a single parameter; else return an array of a parameter for each included field in\n@@ -477,34 +479,9 @@ class OpenAPIConverter(object):\nhttps://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#parameterObject\n\"\"\"\n- return self.fields2parameters(get_fields(schema), schema, **kwargs)\n-\n- def fields2parameters(\n- self, fields, schema=None, use_refs=True,\n- default_in='body', name='body', required=False,\n- description=None, **kwargs\n- ):\n- \"\"\"Return an array of OpenAPI parameters given a mapping between field names and\n- :class:`Field <marshmallow.Field>` objects. If `default_in` is \"body\", then return an array\n- of a single parameter; else return an array of a parameter for each included field in\n- the :class:`Schema <marshmallow.Schema>`.\n-\n- https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#parameterObject\n-\n- In OpenAPI3, only \"query\", \"header\", \"path\" or \"cookie\" are allowed for the location\n- of parameters. In OpenAPI 3, \"requestBody\" is used when fields are in the body.\n-\n- This function always returns a list, with a parameter\n- for each included field in the :class:`Schema <marshmallow.Schema>`.\n-\n- https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#parameterObject\n- \"\"\"\nopenapi_default_in = __location_map__.get(default_in, default_in)\nif self.openapi_version.major < 3 and openapi_default_in == 'body':\n- if schema is not None:\nprop = self.resolve_schema_dict(schema)\n- else:\n- prop = self.fields2jsonschema(fields, use_refs=use_refs)\nparam = {\n'in': openapi_default_in,\n@@ -521,12 +498,30 @@ class OpenAPIConverter(object):\nassert not getattr(schema, 'many', False), \\\n\"Schemas with many=True are only supported for 'json' location (aka 'in: body')\"\n- dump_only_fields = getattr(getattr(schema, 'Meta', None), 'dump_only', [])\n+ fields = get_fields(schema, exclude_dump_only=True)\n+\n+ return self.fields2parameters(fields, default_in=default_in)\n+\n+ def fields2parameters(self, fields, use_refs=True, default_in='body'):\n+ \"\"\"Return an array of OpenAPI parameters given a mapping between field names and\n+ :class:`Field <marshmallow.Field>` objects. If `default_in` is \"body\", then return an array\n+ of a single parameter; else return an array of a parameter for each included field in\n+ the :class:`Schema <marshmallow.Schema>`.\n+\n+ https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#parameterObject\n+ In OpenAPI3, only \"query\", \"header\", \"path\" or \"cookie\" are allowed for the location\n+ of parameters. In OpenAPI 3, \"requestBody\" is used when fields are in the body.\n+\n+ This function always returns a list, with a parameter\n+ for each included field in the :class:`Schema <marshmallow.Schema>`.\n+\n+ https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#parameterObject\n+ \"\"\"\nparameters = []\nbody_param = None\nfor field_name, field_obj in iteritems(fields):\n- if (field_obj.dump_only or field_name in dump_only_fields):\n+ if field_obj.dump_only:\ncontinue\nparam = self.field2parameter(\nfield_obj,\n" }, { "change_type": "MODIFY", "old_path": "tests/test_openapi.py", "new_path": "tests/test_openapi.py", "diff": "@@ -167,7 +167,7 @@ class TestMarshmallowFieldToOpenAPI:\nid = fields.Int()\nschema = ExampleSchema(many=True)\n- res = openapi.fields2parameters(schema.fields, schema=schema, default_in='json')\n+ res = openapi.schema2parameters(schema=schema, default_in='json')\nassert res[0]['in'] == 'body'\ndef test_fields_with_dump_only(self, openapi):\n@@ -183,12 +183,8 @@ class TestMarshmallowFieldToOpenAPI:\nclass Meta:\ndump_only = ('name',)\n- res = openapi.fields2parameters(\n- UserSchema._declared_fields, schema=UserSchema, default_in='query',\n- )\n- assert len(res) == 0\n- res = openapi.fields2parameters(\n- UserSchema().fields, schema=UserSchema, default_in='query',\n+ res = openapi.schema2parameters(\n+ schema=UserSchema, default_in='query',\n)\nassert len(res) == 0\n" } ]
Python
MIT License
marshmallow-code/apispec
redistribute logic between schema2paramaters and fields2parameters
394,000
28.01.2019 11:58:30
18,000
88eba0f3c8bae701a20f43cef7ed30f36dc18961
changes comparision to an instance
[ { "change_type": "MODIFY", "old_path": "tests/test_ext_marshmallow.py", "new_path": "tests/test_ext_marshmallow.py", "diff": "@@ -335,7 +335,7 @@ class TestOperationHelper:\np = get_paths(spec_fixture.spec)['/pet']\nget = p['get']\nassert get['parameters'] == spec_fixture.openapi.schema2parameters(\n- PetSchema, default_in='query',\n+ PetSchema(), default_in='query',\n)\npost = p['post']\nassert post['parameters'] == spec_fixture.openapi.schema2parameters(\n@@ -370,7 +370,7 @@ class TestOperationHelper:\np = get_paths(spec_fixture.spec)['/pet']\nget = p['get']\nassert get['parameters'] == spec_fixture.openapi.schema2parameters(\n- PetSchema, default_in='query',\n+ PetSchema(), default_in='query',\n)\nfor parameter in get['parameters']:\ndescription = parameter.get('description', False)\n" } ]
Python
MIT License
marshmallow-code/apispec
changes comparision to an instance
394,003
28.01.2019 19:55:56
0
3980709e2846ac0060bda5d56d451e5ad491ece8
Translate `marshmallow.validators.Regexp` to pattern string
[ { "change_type": "MODIFY", "old_path": "AUTHORS.rst", "new_path": "AUTHORS.rst", "diff": "@@ -53,3 +53,4 @@ Contributors (chronological)\n- Laura Beaufort `@lbeaufort <https://github.com/lbeaufort>`_\n- Marcin Lulek `@ergo <https://github.com/ergo>`_\n- Jonathan Beezley `@jbeezley <https://github.com/jbeezley>`_\n+- David Stapleton `@dstape <https://github.com/DStape>`_\n" }, { "change_type": "MODIFY", "old_path": "apispec/compat.py", "new_path": "apispec/compat.py", "diff": "# -*- coding: utf-8 -*-\n# flake8: noqa\n+import re\nimport sys\n+RegexType = type(re.compile(''))\n+\nPY2 = int(sys.version[0]) == 2\nif PY2:\n" }, { "change_type": "MODIFY", "old_path": "apispec/ext/marshmallow/openapi.py", "new_path": "apispec/ext/marshmallow/openapi.py", "diff": "@@ -7,6 +7,7 @@ OpenAPI 2.0 spec: https://github.com/OAI/OpenAPI-Specification/blob/master/versi\nfrom __future__ import absolute_import, unicode_literals\nimport operator\nimport functools\n+import warnings\nfrom collections import OrderedDict\nimport marshmallow\n@@ -14,6 +15,7 @@ from marshmallow.utils import is_collection\nfrom marshmallow.compat import iteritems\nfrom marshmallow.orderedset import OrderedSet\n+from apispec.compat import RegexType\nfrom apispec.utils import OpenAPIVersion\nfrom .common import (\nresolve_schema_cls, get_fields, make_schema_key, resolve_schema_instance,\n@@ -329,6 +331,26 @@ class OpenAPIConverter(object):\nattributes[max_attr] = validator.equal\nreturn attributes\n+ def field2pattern(self, field, **kwargs):\n+ \"\"\"Return the dictionary of OpenAPI field attributes for a set of\n+ :class:`Range <marshmallow.validators.Regexp>` validators.\n+\n+ :param Field field: A marshmallow field.\n+ :rtype: dict\n+ \"\"\"\n+ regex_validators = (v for v in field.validators\n+ if isinstance(getattr(v, 'regex', None), RegexType))\n+ v = next(regex_validators, None)\n+ attributes = {} if v is None else {'pattern': v.regex.pattern}\n+\n+ if next(regex_validators, None) is not None:\n+ warnings.warn(\n+ 'More than one regex validator defined on {} field.'\n+ .format(type(field)), UserWarning,\n+ )\n+\n+ return attributes\n+\ndef metadata2properties(self, field):\n\"\"\"Return a dictionary of properties extracted from field Metadata\n@@ -384,6 +406,7 @@ class OpenAPIConverter(object):\nself.field2nullable,\nself.field2range,\nself.field2length,\n+ self.field2pattern,\nself.metadata2properties,\n):\nret.update(attr_func(field))\n" }, { "change_type": "MODIFY", "old_path": "tests/test_openapi.py", "new_path": "tests/test_openapi.py", "diff": "# -*- coding: utf-8 -*-\n+import re\nimport warnings\nimport pytest\n@@ -235,6 +236,38 @@ class TestMarshmallowFieldToOpenAPI:\nelse:\nassert res['nullable'] is True\n+ def test_field_with_str_regex(self, openapi):\n+ regex_str = '^[a-zA-Z0-9]$'\n+ field = fields.Str(validate=validate.Regexp(regex_str))\n+ ret = openapi.field2property(field)\n+ assert ret['pattern'] == regex_str\n+\n+ def test_field_with_pattern_obj_regex(self, openapi):\n+ regex_str = '^[a-zA-Z0-9]$'\n+ field = fields.Str(validate=validate.Regexp(re.compile(regex_str)))\n+ ret = openapi.field2property(field)\n+ assert ret['pattern'] == regex_str\n+\n+ def test_field_with_no_pattern(self, openapi):\n+ field = fields.Str()\n+ ret = openapi.field2property(field)\n+ assert 'pattern' not in ret\n+\n+ def test_field_with_multiple_patterns(self, recwarn, openapi):\n+ regex_validators = [\n+ validate.Regexp('winner'),\n+ validate.Regexp('loser'),\n+ ]\n+ field = fields.Str(validate=regex_validators)\n+ with warnings.catch_warnings():\n+ warnings.simplefilter('always')\n+ ret = openapi.field2property(field)\n+ warning = recwarn.pop()\n+ expected_msg = 'More than one regex validator defined on {} field.'\n+ assert warning.category == UserWarning\n+ assert str(warning.message) == expected_msg.format(type(field))\n+ assert ret['pattern'] == 'winner'\n+\nclass TestMarshmallowSchemaToModelDefinition:\ndef test_invalid_schema(self, openapi):\n" } ]
Python
MIT License
marshmallow-code/apispec
Translate `marshmallow.validators.Regexp` to pattern string
394,032
12.04.2019 00:13:01
-7,200
c634cb023300ea87021e84f3c6bbd4d9dba3f6c6
Fix Marshmallow Schema's Meta exclude field list/tuple error
[ { "change_type": "MODIFY", "old_path": "src/apispec/ext/marshmallow/common.py", "new_path": "src/apispec/ext/marshmallow/common.py", "diff": "@@ -73,7 +73,7 @@ def warn_if_fields_defined_in_meta(fields, Meta):\n\"\"\"Warns user that fields defined in Meta.fields or Meta.additional will\nbe ignored\n- :param dict fields: A dictionary of of fields name field object pairs\n+ :param dict fields: A dictionary of fields name field object pairs\n:param Meta: the schema's Meta class\n\"\"\"\nif getattr(Meta, \"fields\", None) or getattr(Meta, \"additional\", None):\n@@ -91,13 +91,13 @@ def warn_if_fields_defined_in_meta(fields, Meta):\ndef filter_excluded_fields(fields, Meta, exclude_dump_only):\n\"\"\"Filter fields that should be ignored in the OpenAPI spec\n- :param dict fields: A dictionary of of fields name field object pairs\n+ :param dict fields: A dictionary of fields name field object pairs\n:param Meta: the schema's Meta class\n:param bool exclude_dump_only: whether to filter fields in Meta.dump_only\n\"\"\"\n- exclude = getattr(Meta, \"exclude\", [])\n+ exclude = list(getattr(Meta, \"exclude\", []))\nif exclude_dump_only:\n- exclude += getattr(Meta, \"dump_only\", [])\n+ exclude.extend(getattr(Meta, \"dump_only\", []))\nfiltered_fields = OrderedDict(\n(key, value) for key, value in fields.items() if key not in exclude\n" }, { "change_type": "MODIFY", "old_path": "tests/schemas.py", "new_path": "tests/schemas.py", "diff": "@@ -53,6 +53,30 @@ class OrderedSchema(Schema):\nordered = True\n+class ExcludeSchema(Schema):\n+ field1 = fields.Int()\n+ field2 = fields.Int()\n+ field3 = fields.Int()\n+ field4 = fields.Int()\n+ field5 = fields.Int()\n+\n+ class Meta:\n+ exclude = (\"field2\", \"field4\")\n+ dump_only = [\"field3\"]\n+\n+\n+class ExcludeSchema2(Schema):\n+ field1 = fields.Int()\n+ field2 = fields.Int()\n+ field3 = fields.Int()\n+ field4 = fields.Int()\n+ field5 = fields.Int()\n+\n+ class Meta:\n+ exclude = [\"field3\", \"field5\"]\n+ dump_only = (\"field1\",)\n+\n+\nclass DefaultValuesSchema(Schema):\nnumber_auto_default = fields.Int(missing=12)\nnumber_manual_default = fields.Int(missing=12, doc_default=42)\n" }, { "change_type": "MODIFY", "old_path": "tests/test_ext_marshmallow_common.py", "new_path": "tests/test_ext_marshmallow_common.py", "diff": "# -*- coding: utf-8 -*-\nimport pytest\n-from apispec.ext.marshmallow.common import make_schema_key, get_unique_schema_name\n-from .schemas import PetSchema, SampleSchema\n+from apispec.ext.marshmallow.common import (\n+ make_schema_key,\n+ get_unique_schema_name,\n+ get_fields,\n+)\n+from .schemas import PetSchema, SampleSchema, ExcludeSchema, ExcludeSchema2\nclass TestMakeSchemaKey:\n@@ -43,3 +47,21 @@ class TestUniqueName:\n):\nname_2 = get_unique_schema_name(spec.components, \"Pet\")\nassert name_2 == \"Pet2\"\n+\n+\n+class TestMetaExclude:\n+ def test_meta_tuple_in_exclude(self):\n+ keys = set(get_fields(ExcludeSchema).keys())\n+ assert keys == {\"field1\", \"field3\", \"field5\"}\n+\n+ def test_meta_list_in_exclude(self):\n+ keys = set(get_fields(ExcludeSchema2).keys())\n+ assert keys == {\"field1\", \"field2\", \"field4\"}\n+\n+ def test_meta_tuple_in_dump_only(self):\n+ keys = set(get_fields(ExcludeSchema, exclude_dump_only=True).keys())\n+ assert keys == {\"field1\", \"field5\"}\n+\n+ def test_meta_list_in_dump_only(self):\n+ keys = set(get_fields(ExcludeSchema2, exclude_dump_only=True).keys())\n+ assert keys == {\"field2\", \"field4\"}\n" } ]
Python
MIT License
marshmallow-code/apispec
Fix Marshmallow Schema's Meta exclude field list/tuple error
394,015
16.04.2019 15:07:14
-3,600
ec9758b9420c6fa70c1f4629a3ee2df87a86999e
Use pytest.mark consistently There are many uses of pytest.mark and two of them use the imported mark symbol. Most uses access it via pytest.mark. This changes the two inconsistent references to also use pytest.mark.
[ { "change_type": "MODIFY", "old_path": "tests/test_ext_marshmallow_openapi.py", "new_path": "tests/test_ext_marshmallow_openapi.py", "diff": "@@ -4,7 +4,6 @@ import re\nimport warnings\nimport pytest\n-from pytest import mark\nfrom marshmallow import fields, Schema, validate\n@@ -21,7 +20,7 @@ class TestMarshmallowFieldToOpenAPI:\nfield = fields.String(validate=validate.OneOf(choices))\nassert openapi.field2choices(field) == {\"enum\": choices}\n- @mark.parametrize(\n+ @pytest.mark.parametrize(\n(\"FieldClass\", \"jsontype\"),\n[\n(fields.Integer, \"integer\"),\n@@ -53,7 +52,7 @@ class TestMarshmallowFieldToOpenAPI:\nassert res[\"type\"] == \"array\"\nassert res[\"items\"] == openapi.field2property(fields.String())\n- @mark.parametrize(\n+ @pytest.mark.parametrize(\n(\"FieldClass\", \"expected_format\"),\n[\n(fields.Integer, \"int32\"),\n" } ]
Python
MIT License
marshmallow-code/apispec
Use pytest.mark consistently There are many uses of pytest.mark and two of them use the imported mark symbol. Most uses access it via pytest.mark. This changes the two inconsistent references to also use pytest.mark.
394,015
16.04.2019 15:18:51
-3,600
fef98268799adb9cc910eba2d9ec3e10b2a368fa
Parameterize the validation property tests Rather than test each field validation property with a separate test, each field can have a set of properties that gets checked.
[ { "change_type": "MODIFY", "old_path": "tests/test_ext_marshmallow_openapi.py", "new_path": "tests/test_ext_marshmallow_openapi.py", "diff": "@@ -853,56 +853,22 @@ class ValidationSchema(Schema):\nclass TestFieldValidation:\n- def test_range(self, spec):\n- spec.components.schema(\"Validation\", schema=ValidationSchema)\n- result = get_schemas(spec)[\"Validation\"][\"properties\"][\"range\"]\n-\n- assert \"minimum\" in result\n- assert result[\"minimum\"] == 1\n- assert \"maximum\" in result\n- assert result[\"maximum\"] == 10\n-\n- def test_multiple_ranges(self, spec):\n- spec.components.schema(\"Validation\", schema=ValidationSchema)\n- result = get_schemas(spec)[\"Validation\"][\"properties\"][\"multiple_ranges\"]\n-\n- assert \"minimum\" in result\n- assert result[\"minimum\"] == 3\n- assert \"maximum\" in result\n- assert result[\"maximum\"] == 7\n-\n- def test_list_length(self, spec):\n- spec.components.schema(\"Validation\", schema=ValidationSchema)\n- result = get_schemas(spec)[\"Validation\"][\"properties\"][\"list_length\"]\n-\n- assert \"minItems\" in result\n- assert result[\"minItems\"] == 1\n- assert \"maxItems\" in result\n- assert result[\"maxItems\"] == 10\n-\n- def test_string_length(self, spec):\n- spec.components.schema(\"Validation\", schema=ValidationSchema)\n- result = get_schemas(spec)[\"Validation\"][\"properties\"][\"string_length\"]\n-\n- assert \"minLength\" in result\n- assert result[\"minLength\"] == 1\n- assert \"maxLength\" in result\n- assert result[\"maxLength\"] == 10\n-\n- def test_multiple_lengths(self, spec):\n- spec.components.schema(\"Validation\", schema=ValidationSchema)\n- result = get_schemas(spec)[\"Validation\"][\"properties\"][\"multiple_lengths\"]\n-\n- assert \"minLength\" in result\n- assert result[\"minLength\"] == 3\n- assert \"maxLength\" in result\n- assert result[\"maxLength\"] == 7\n- def test_equal_length(self, spec):\n+ @pytest.mark.parametrize(\n+ (\"field\", \"properties\"),\n+ [\n+ (\"range\", {\"minimum\": 1, \"maximum\": 10}),\n+ (\"multiple_ranges\", {\"minimum\": 3, \"maximum\": 7}),\n+ (\"list_length\", {\"minItems\": 1, \"maxItems\": 10}),\n+ (\"string_length\", {\"minLength\": 1, \"maxLength\": 10}),\n+ (\"multiple_lengths\", {\"minLength\": 3, \"maxLength\": 7}),\n+ (\"equal_length\", {\"minLength\": 5, \"maxLength\": 5}),\n+ ],\n+ )\n+ def test_properties(self, field, properties, spec):\nspec.components.schema(\"Validation\", schema=ValidationSchema)\n- result = get_schemas(spec)[\"Validation\"][\"properties\"][\"equal_length\"]\n+ result = get_schemas(spec)[\"Validation\"][\"properties\"][field]\n- assert \"minLength\" in result\n- assert result[\"minLength\"] == 5\n- assert \"maxLength\" in result\n- assert result[\"maxLength\"] == 5\n+ for attr, expected_value in properties.items():\n+ assert attr in result\n+ assert result[attr] == expected_value\n" } ]
Python
MIT License
marshmallow-code/apispec
Parameterize the validation property tests Rather than test each field validation property with a separate test, each field can have a set of properties that gets checked.
394,015
16.04.2019 15:21:36
-3,600
53c324d618e789e5a2a41da401469d5b47e46ba2
Reduce scope of ValidationSchema to the test class
[ { "change_type": "MODIFY", "old_path": "tests/test_ext_marshmallow_openapi.py", "new_path": "tests/test_ext_marshmallow_openapi.py", "diff": "@@ -826,6 +826,7 @@ def test_openapi_tools_validate_v3():\npytest.fail(str(error))\n+class TestFieldValidation:\nclass ValidationSchema(Schema):\nid = fields.Int(dump_only=True)\nrange = fields.Int(validate=validate.Range(min=1, max=10))\n@@ -851,9 +852,6 @@ class ValidationSchema(Schema):\nvalidate=[validate.Length(equal=5), validate.Length(min=1, max=10)]\n)\n-\n-class TestFieldValidation:\n-\[email protected](\n(\"field\", \"properties\"),\n[\n@@ -866,7 +864,7 @@ class TestFieldValidation:\n],\n)\ndef test_properties(self, field, properties, spec):\n- spec.components.schema(\"Validation\", schema=ValidationSchema)\n+ spec.components.schema(\"Validation\", schema=self.ValidationSchema)\nresult = get_schemas(spec)[\"Validation\"][\"properties\"][field]\nfor attr, expected_value in properties.items():\n" } ]
Python
MIT License
marshmallow-code/apispec
Reduce scope of ValidationSchema to the test class
394,015
18.04.2019 15:50:58
-3,600
3f6347af4ecea2a98cb426f21571a7b8af7b4698
Find type and format for field using type hierarchy When a custom field is not directly found in the field mapping then we use the MRO to look at parent classes to find a suitable class to work out what type of field this is.
[ { "change_type": "MODIFY", "old_path": "src/apispec/ext/marshmallow/openapi.py", "new_path": "src/apispec/ext/marshmallow/openapi.py", "diff": "@@ -163,7 +163,20 @@ class OpenAPIConverter(object):\n:param Field field: A marshmallow field.\n:rtype: dict\n\"\"\"\n- type_, fmt = self.field_mapping.get(type(field), (\"string\", None))\n+ # If this type isn't directly in the field mapping then check the\n+ # hierarchy until we find something that does.\n+ for field_class in type(field).__mro__:\n+ if field_class in self.field_mapping:\n+ type_, fmt = self.field_mapping[field_class]\n+ break\n+ else:\n+ warnings.warn(\n+ \"Field of type {} does not inherit from marshmallow.Field.\".format(\n+ type(field)\n+ ),\n+ UserWarning,\n+ )\n+ type_, fmt = \"string\", None\nret = {\"type\": type_}\n" }, { "change_type": "MODIFY", "old_path": "tests/test_ext_marshmallow_openapi.py", "new_path": "tests/test_ext_marshmallow_openapi.py", "diff": "@@ -14,6 +14,18 @@ from apispec import exceptions, utils, APISpec\nfrom .utils import get_schemas, build_ref\n+class CustomList(fields.List):\n+ pass\n+\n+\n+class CustomStringField(fields.String):\n+ pass\n+\n+\n+class CustomIntegerField(fields.Integer):\n+ pass\n+\n+\nclass TestMarshmallowFieldToOpenAPI:\ndef test_field2choices_preserving_order(self, openapi):\nchoices = [\"a\", \"b\", \"c\", \"aa\", \"0\", \"cc\"]\n@@ -39,6 +51,9 @@ class TestMarshmallowFieldToOpenAPI:\n# Assume base Field and Raw are strings\n(fields.Field, \"string\"),\n(fields.Raw, \"string\"),\n+ # Custom fields inherit types from their parents\n+ (CustomStringField, \"string\"),\n+ (CustomIntegerField, \"integer\"),\n],\n)\ndef test_field2property_type(self, FieldClass, jsontype, openapi):\n@@ -46,8 +61,9 @@ class TestMarshmallowFieldToOpenAPI:\nres = openapi.field2property(field)\nassert res[\"type\"] == jsontype\n- def test_formatted_field_translates_to_array(self, openapi):\n- field = fields.List(fields.String)\n+ @pytest.mark.parametrize(\"ListClass\", [fields.List, CustomList])\n+ def test_formatted_field_translates_to_array(self, ListClass, openapi):\n+ field = ListClass(fields.String)\nres = openapi.field2property(field)\nassert res[\"type\"] == \"array\"\nassert res[\"items\"] == openapi.field2property(fields.String())\n@@ -434,8 +450,9 @@ class TestMarshmallowSchemaToModelDefinition:\nclass TestMarshmallowSchemaToParameters:\n- def test_field_multiple(self, openapi):\n- field = fields.List(fields.Str, location=\"querystring\")\n+ @pytest.mark.parametrize(\"ListClass\", [fields.List, CustomList])\n+ def test_field_multiple(self, ListClass, openapi):\n+ field = ListClass(fields.Str, location=\"querystring\")\nres = openapi.field2parameter(field, name=\"field\")\nassert res[\"in\"] == \"query\"\nif openapi.openapi_version.major < 3:\n@@ -839,7 +856,11 @@ class TestFieldValidation:\n]\n)\nlist_length = fields.List(fields.Str, validate=validate.Length(min=1, max=10))\n+ custom_list_length = CustomList(\n+ fields.Str, validate=validate.Length(min=1, max=10)\n+ )\nstring_length = fields.Str(validate=validate.Length(min=1, max=10))\n+ custom_field_length = CustomStringField(validate=validate.Length(min=1, max=10))\nmultiple_lengths = fields.Str(\nvalidate=[\nvalidate.Length(min=1),\n@@ -858,7 +879,9 @@ class TestFieldValidation:\n(\"range\", {\"minimum\": 1, \"maximum\": 10}),\n(\"multiple_ranges\", {\"minimum\": 3, \"maximum\": 7}),\n(\"list_length\", {\"minItems\": 1, \"maxItems\": 10}),\n+ (\"custom_list_length\", {\"minItems\": 1, \"maxItems\": 10}),\n(\"string_length\", {\"minLength\": 1, \"maxLength\": 10}),\n+ (\"custom_field_length\", {\"minLength\": 1, \"maxLength\": 10}),\n(\"multiple_lengths\", {\"minLength\": 3, \"maxLength\": 7}),\n(\"equal_length\", {\"minLength\": 5, \"maxLength\": 5}),\n],\n" } ]
Python
MIT License
marshmallow-code/apispec
Find type and format for field using type hierarchy When a custom field is not directly found in the field mapping then we use the MRO to look at parent classes to find a suitable class to work out what type of field this is.
393,988
31.03.2019 11:41:12
-7,200
980f250c3e45ee92d9c4a21d6c40b62b948d08dd
Ensure make_schema_key returns a unique key on unhashable iterables
[ { "change_type": "MODIFY", "old_path": "src/apispec/ext/marshmallow/common.py", "new_path": "src/apispec/ext/marshmallow/common.py", "diff": "@@ -113,9 +113,11 @@ def make_schema_key(schema):\nfor modifier in MODIFIERS:\nattribute = getattr(schema, modifier)\ntry:\n+ # Hashable (string, tuple)\nhash(attribute)\nexcept TypeError:\n- attribute = tuple(attribute)\n+ # Unhashable iterable (list, set)\n+ attribute = frozenset(attribute)\nmodifiers.append(attribute)\nreturn SchemaKey(schema.__class__, *modifiers)\n" }, { "change_type": "MODIFY", "old_path": "tests/test_ext_marshmallow_common.py", "new_path": "tests/test_ext_marshmallow_common.py", "diff": "@@ -19,6 +19,11 @@ class TestMakeSchemaKey:\ndef test_same_schemas_instances_equal(self):\nassert make_schema_key(PetSchema()) == make_schema_key(PetSchema())\n+ def test_same_schemas_instances_with_sets_equal(self):\n+ # Note: this test relies on non-deterministic hashing behaviour:\n+ for i in range(0, 50):\n+ assert make_schema_key(PetSchema(load_only=('1', '2', '3', '4'))) == make_schema_key(PetSchema(load_only=('4', '3', '2', '1')))\n+\ndef test_different_schemas_not_equal(self):\nassert make_schema_key(PetSchema()) != make_schema_key(SampleSchema())\n" } ]
Python
MIT License
marshmallow-code/apispec
Ensure make_schema_key returns a unique key on unhashable iterables
394,015
01.05.2019 16:32:13
-3,600
749a7821b49ff73688da1f1f1ef5842be1dc8005
Update marshmallow plugin documentation for custom types Now that the OpenAPI type for a custom field uses the class hierarchy to work out what OpenAPI type to use, the documentation needs updating. This change expands on how to use the map_to_openapi_type decorator and explains that cases where it is no longer necessary.
[ { "change_type": "MODIFY", "old_path": "docs/using_plugins.rst", "new_path": "docs/using_plugins.rst", "diff": "@@ -232,35 +232,36 @@ apispec will respect schema modifiers such as ``exclude`` and ``partial`` in the\nCustom Fields\n***************\n-By default, apispec only knows how to set the type of\n-built-in marshmallow fields. If you want to generate definitions for\n-schemas with custom fields, use the\n-`apispec.ext.marshmallow.MarshmallowPlugin.map_to_openapi_type` decorator.\n+By default, apispec knows how to map class of the provided marshmallow fields to the\n+correct OpenAPI type. If your custom field sub-classes a standard marshmallow field\n+class then it will inherit the default mapping. If you want to override the OpenAPI\n+type in the generated definitions for schemas with custom fields, use the\n+`apispec.ext.marshmallow.MarshmallowPlugin.map_to_openapi_type` decorator. This can\n+be invoked with either a pair of strings which provide the OpenAPI type, or a\n+marshmallow field that has the same target mapping.\n.. code-block:: python\nfrom apispec import APISpec\nfrom apispec.ext.marshmallow import MarshmallowPlugin\n- from marshmallow.fields import Integer\n+ from marshmallow.fields import Integer, Field\nma_plugin = MarshmallowPlugin()\n- spec = APISpec(\n- title=\"Gisty\",\n- version=\"1.0.0\",\n- openapi_version=\"3.0.2\",\n- info=dict(description=\"A minimal gist API\"),\n- plugins=[ma_plugin],\n- )\n+\n+ # Inherits Integer mapping of ('integer', 'int32')\n+ class MyCustomInteger(Integer):\n+ pass\n+ # Override Integer mapping\n@ma_plugin.map_to_openapi_type(\"string\", \"uuid\")\nclass MyCustomField(Integer):\npass\n@ma_plugin.map_to_openapi_type(Integer) # will map to ('integer', 'int32')\n- class MyCustomFieldThatsKindaLikeAnInteger(Integer):\n+ class MyCustomFieldThatsKindaLikeAnInteger(Field):\npass\n" } ]
Python
MIT License
marshmallow-code/apispec
Update marshmallow plugin documentation for custom types Now that the OpenAPI type for a custom field uses the class hierarchy to work out what OpenAPI type to use, the documentation needs updating. This change expands on how to use the map_to_openapi_type decorator and explains that cases where it is no longer necessary.
393,991
13.06.2019 00:45:38
-7,200
3c01ee2e84c0dc2de7f5a9719b06a4256fa2c71c
Add new `DuplicateParameterError` exception * Raise this new error instead of `APIError` when finding duplicates in parameters * Update tests to check if that exception is raised instead of base `APISpecError` * Split tests for duplicate parameters
[ { "change_type": "MODIFY", "old_path": "src/apispec/core.py", "new_path": "src/apispec/core.py", "diff": "@@ -8,6 +8,7 @@ from .exceptions import (\nAPISpecError,\nPluginMethodNotImplementedError,\nDuplicateComponentNameError,\n+ DuplicateParameterError,\n)\nfrom .utils import OpenAPIVersion, deepupdate, COMPONENT_SUBSECTIONS, build_reference\n@@ -59,7 +60,7 @@ def clean_parameters(parameters, openapi_major_version):\nseen = set()\nfor p in param_objs:\nif p in seen:\n- raise APISpecError(\n+ raise DuplicateParameterError(\n\"Duplicate parameter with name {} and location {}\".format(p[0], p[1])\n)\nseen.add(p)\n" }, { "change_type": "MODIFY", "old_path": "src/apispec/exceptions.py", "new_path": "src/apispec/exceptions.py", "diff": "@@ -14,5 +14,9 @@ class DuplicateComponentNameError(APISpecError):\n\"\"\"Raised when registering two components with the same name\"\"\"\n+class DuplicateParameterError(APISpecError):\n+ \"\"\"Raised when registering a parameter already existing in a given scope\"\"\"\n+\n+\nclass OpenAPIError(APISpecError):\n\"\"\"Raised when a OpenAPI spec validation fails.\"\"\"\n" }, { "change_type": "MODIFY", "old_path": "tests/test_core.py", "new_path": "tests/test_core.py", "diff": "@@ -6,7 +6,11 @@ import sys\nimport yaml\nfrom apispec import APISpec, BasePlugin\n-from apispec.exceptions import APISpecError, DuplicateComponentNameError\n+from apispec.exceptions import (\n+ APISpecError,\n+ DuplicateComponentNameError,\n+ DuplicateParameterError,\n+)\nfrom .utils import (\nget_schemas,\n@@ -399,6 +403,7 @@ class TestPath:\n== metadata[\"components\"][\"parameters\"][\"test_parameter\"]\n)\n+ def test_parameter_duplicate(self, spec):\nspec.path(\npath=\"/pet/{petId}\",\noperations={\n@@ -411,7 +416,7 @@ class TestPath:\n},\n)\n- with pytest.raises(APISpecError):\n+ with pytest.raises(DuplicateParameterError):\nspec.path(\npath=\"/pet/{petId}\",\noperations={\n@@ -435,17 +440,13 @@ class TestPath:\nparameters=[{\"name\": \"petId\", \"in\": \"path\"}, \"test_parameter\"],\n)\n- if spec.openapi_version.major < 3:\n- assert get_paths(spec)[path][\"parameters\"] == [\n- {\"name\": \"petId\", \"in\": \"path\", \"required\": True},\n- {\"$ref\": \"#/parameters/test_parameter\"},\n- ]\n- else:\nassert get_paths(spec)[path][\"parameters\"] == [\n{\"name\": \"petId\", \"in\": \"path\", \"required\": True},\n- {\"$ref\": \"#/components/parameters/test_parameter\"},\n+ build_ref(spec, \"parameter\", \"test_parameter\"),\n]\n+ def test_global_parameter_duplicate(self, spec):\n+ path = \"/pet/{petId}\"\nspec.path(\npath=path,\noperations=dict(put={}, get={}),\n@@ -455,18 +456,12 @@ class TestPath:\n],\n)\n- if spec.openapi_version.major < 3:\n- assert get_paths(spec)[path][\"parameters\"] == [\n- {\"name\": \"petId\", \"in\": \"path\", \"required\": True},\n- {\"name\": \"petId\", \"in\": \"query\"},\n- ]\n- else:\nassert get_paths(spec)[path][\"parameters\"] == [\n{\"name\": \"petId\", \"in\": \"path\", \"required\": True},\n{\"name\": \"petId\", \"in\": \"query\"},\n]\n- with pytest.raises(APISpecError):\n+ with pytest.raises(DuplicateParameterError):\nspec.path(\npath=path,\noperations=dict(put={}, get={}),\n" } ]
Python
MIT License
marshmallow-code/apispec
Add new `DuplicateParameterError` exception * Raise this new error instead of `APIError` when finding duplicates in parameters * Update tests to check if that exception is raised instead of base `APISpecError` * Split tests for duplicate parameters
393,991
13.06.2019 13:59:36
-7,200
a2069bd296cef28aa4f51fe169a11ce06be26c44
Enfore "required" to "True" for path parameters * Forced `required` value to `True` if parameter location is set to "path" * Updated `test_parameter` according to this
[ { "change_type": "MODIFY", "old_path": "src/apispec/core.py", "new_path": "src/apispec/core.py", "diff": "@@ -197,6 +197,11 @@ class Components(object):\nret = component.copy()\nret.setdefault(\"name\", component_id)\nret[\"in\"] = location\n+\n+ # if \"in\" is set to \"path\", enforce required flag to True\n+ if location == \"path\":\n+ ret[\"required\"] = True\n+\n# Execute all helpers from plugins\nfor plugin in self._plugins:\ntry:\n" }, { "change_type": "MODIFY", "old_path": "tests/test_core.py", "new_path": "tests/test_core.py", "diff": "@@ -190,6 +190,7 @@ class TestComponents:\n\"type\": \"integer\",\n\"in\": \"path\",\n\"name\": \"PetId\",\n+ \"required\": True,\n}\ndef test_parameter_is_chainable(self, spec):\n" } ]
Python
MIT License
marshmallow-code/apispec
Enfore "required" to "True" for path parameters * Forced `required` value to `True` if parameter location is set to "path" * Updated `test_parameter` according to this
393,991
13.06.2019 14:54:16
-7,200
2d4c85b6a3d97e063ae95ba5722bc3308a7f1082
Fixed leftover of parametrized tests
[ { "change_type": "MODIFY", "old_path": "tests/test_core.py", "new_path": "tests/test_core.py", "diff": "@@ -415,9 +415,6 @@ class TestPath:\nwith pytest.raises(InvalidParameterError):\nspec.path(path=path, operations=dict(put={}, get={}), parameters=parameters)\n- with pytest.raises(InvalidParameterError):\n- spec.path(path=path, operations=dict(put={}, get={}), parameters=parameters)\n-\ndef test_parameter_duplicate(self, spec):\nspec.path(\npath=\"/pet/{petId}\",\n" } ]
Python
MIT License
marshmallow-code/apispec
Fixed leftover of parametrized tests
393,991
15.06.2019 00:33:34
-7,200
a966a040410a9c089de0ae41c888526c4a896012
Plugin documentation and tests update * Updated docstring to include kwargs decription * Updated `apispec.plugin.BasePlugin.path` docstring to include `parameters` * Updated `writing_plugins.rst` to reflect parameters changes and include `kwargs` example * Updated `test_core.TestPlugins.test_plugin_path_hlper_is_used` to include `parameters` argument
[ { "change_type": "MODIFY", "old_path": "docs/writing_plugins.rst", "new_path": "docs/writing_plugins.rst", "diff": "@@ -29,7 +29,7 @@ A plugin with a path helper function may look something like this:\nclass MyPlugin(BasePlugin):\n- def path_helper(self, path, func, **kwargs):\n+ def path_helper(self, path, func, parameters, **kwargs):\n\"\"\"Path helper that parses docstrings for operations. Adds a\n``func`` parameter to `apispec.APISpec.path`.\n\"\"\"\n@@ -37,6 +37,56 @@ A plugin with a path helper function may look something like this:\nreturn Path(path=path, operations=operations)\n+All helpers take `**kwargs` arguments that are passed to `apispec.APISpec` methods by users and forwarded to plugins methods,\n+allowing them to take extra arguments if required.\n+\n+A plugin with an operations helper that add `deprecated` flag may look like this\n+\n+.. code-block:: python\n+\n+ # deprecated_plugin.py\n+\n+ from apispec import BasePlugin\n+ from apispec.compat import iteritems\n+ from apispec.yaml_utils import load_operations_from_docstring\n+\n+\n+ class DeprecatedPlugin(BasePlugin):\n+ def operation_helper(self, path, operations, **kwargs):\n+ \"\"\"Operation helper that add `deprecated` flag if in `kwargs`\n+ \"\"\"\n+ if kwargs.pop(\"deprecated\", False) is True:\n+ for key, value in iteritems(operations):\n+ value[\"deprecated\"] = True\n+\n+\n+Using this plugin\n+\n+\n+.. code-block:: python\n+\n+ import json\n+ from apispec import APISpec\n+ from deprecated_plugin import DeprecatedPlugin\n+\n+ spec = APISpec(\n+ title=\"Gisty\",\n+ version=\"1.0.0\",\n+ openapi_version=\"3.0.2\",\n+ plugins=[DeprecatedPlugin()],\n+ )\n+\n+ # path will call operation_helper on his operations\n+ spec.path(\n+ path=\"/gists/{gist_id}\",\n+ operations={\"get\": {\"responses\": {\"200\": {\"description\": \"standard response\"}}}},\n+ deprecated=True,\n+ )\n+ print(json.dumps(spec.to_dict()[\"paths\"]))\n+ # {\"/gists/{gist_id}\": {\"get\": {\"responses\": {\"200\": {\"description\": \"standard response\"}}, \"deprecated\": true}}}\n+\n+\n+\nThe ``init_spec`` Method\n------------------------\n@@ -111,5 +161,5 @@ Next Steps\nTo learn more about how to write plugins:\n* Consult the :doc:`Core API docs <api_core>` for `BasePlugin <apispec.BasePlugin>`\n-* View the source for an existing apispec plugin, e.g. `FlaskPlugin <https://github.com/marshmallow-code/apispec-webframeworks/blob/master/apispec_webframeworks/flask.py>`_.\n+* View the source for an existing apispec plugin, e.g. `FlaskPlugin <https://github.com/marshmallow-code/apispec-webframeworks/blob/master/src/apispec_webframeworks/flask.py>`_.\n* Check out some projects using apispec: https://github.com/marshmallow-code/apispec/wiki/Ecosystem\n" }, { "change_type": "MODIFY", "old_path": "src/apispec/plugin.py", "new_path": "src/apispec/plugin.py", "diff": "@@ -15,23 +15,40 @@ class BasePlugin(object):\n\"\"\"\ndef schema_helper(self, name, definition, **kwargs):\n- \"\"\"May return definition as a dict.\"\"\"\n+ \"\"\"May return definition as a dict.\n+\n+ :param str name: identifier by which schema may be referenced\n+ :param dict definition: schema definition\n+ :param dict kwargs: all additional keywords arguments sent to `APISpec.schema()`\n+ \"\"\"\nraise PluginMethodNotImplementedError\ndef parameter_helper(self, parameter, **kwargs):\n- \"\"\"May return parameter component description as a dict.\"\"\"\n+ \"\"\"May return parameter component description as a dict.\n+\n+ :param dict parameter: parameter fields\n+ :param dict kwargs: all additional keywords arguments sent to `APISpec.parameter()`\n+ \"\"\"\nraise PluginMethodNotImplementedError\ndef response_helper(self, response, **kwargs):\n- \"\"\"May return response component description as a dict.\"\"\"\n+ \"\"\"May return response component description as a dict.\n+\n+ :param dict response: response fields\n+ :param dict kwargs: all additional keywords arguments sent to `APISpec.response()`\n+ \"\"\"\nraise PluginMethodNotImplementedError\n- def path_helper(self, path=None, operations=None, **kwargs):\n- \"\"\"May return a path as string and mutate operations dict.\n+ def path_helper(self, path=None, operations=None, parameters=None, **kwargs):\n+ \"\"\"May return a path as string and mutate operations dict and parameters list.\n:param str path: Path to the resource\n:param dict operations: A `dict` mapping HTTP methods to operation object. See\nhttps://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#operationObject\n+ :param list parameters: A `list` of parameters objects or references for the path. See\n+ https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#parameterObject\n+ and https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#referenceObject\n+ :param dict kwargs: all additional keywords arguments sent to `APISpec.path()`\nReturn value should be a string or None. If a string is returned, it\nis set as the path.\n@@ -45,7 +62,10 @@ class BasePlugin(object):\ndef operation_helper(self, path=None, operations=None, **kwargs):\n\"\"\"May mutate operations.\n+\n:param str path: Path to the resource\n- :param dict operations: A `dict` mapping HTTP methods to operation object. See\n+ :param dict operations: A `dict` mapping HTTP methods to operation object.\n+ See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#operationObject\n+ :param dict kwargs: all additional keywords arguments sent to `APISpec.path()`\n\"\"\"\nraise PluginMethodNotImplementedError\n" }, { "change_type": "MODIFY", "old_path": "tests/test_core.py", "new_path": "tests/test_core.py", "diff": "@@ -560,10 +560,11 @@ class TestPlugins:\nif not return_none:\nreturn {\"description\": \"42\"}\n- def path_helper(self, path, operations, **kwargs):\n+ def path_helper(self, path, operations, parameters, **kwargs):\nif not return_none:\nif path == \"/path_1\":\noperations.update({\"get\": {\"responses\": {\"200\": {}}}})\n+ parameters.append({\"name\": \"page\", \"in\": \"query\"})\nreturn \"/path_1_modified\"\ndef operation_helper(self, path, operations, **kwargs):\n@@ -639,7 +640,10 @@ class TestPlugins:\nif return_none:\nassert paths[\"/path_1\"] == {}\nelse:\n- assert paths[\"/path_1_modified\"] == {\"get\": {\"responses\": {\"200\": {}}}}\n+ assert paths[\"/path_1_modified\"] == {\n+ \"get\": {\"responses\": {\"200\": {}}},\n+ \"parameters\": [{\"in\": \"query\", \"name\": \"page\"}],\n+ }\[email protected](\"openapi_version\", (\"2.0\", \"3.0.0\"))\ndef test_plugin_operation_helper_is_used(self, openapi_version):\n" } ]
Python
MIT License
marshmallow-code/apispec
Plugin documentation and tests update * Updated docstring to include kwargs decription * Updated `apispec.plugin.BasePlugin.path` docstring to include `parameters` * Updated `writing_plugins.rst` to reflect parameters changes and include `kwargs` example * Updated `test_core.TestPlugins.test_plugin_path_hlper_is_used` to include `parameters` argument
394,000
19.07.2019 17:16:24
14,400
329d6164038a906fc0a9575123c8d5d01bd37751
changes schema_name_resolver to accept a schema instance, class, or string
[ { "change_type": "MODIFY", "old_path": "src/apispec/ext/marshmallow/__init__.py", "new_path": "src/apispec/ext/marshmallow/__init__.py", "diff": "@@ -52,14 +52,15 @@ import warnings\nfrom apispec import BasePlugin\nfrom apispec.compat import itervalues\n-from .common import resolve_schema_instance, make_schema_key\n+from .common import resolve_schema_instance, make_schema_key, resolve_schema_cls\nfrom .openapi import OpenAPIConverter\ndef resolver(schema):\n\"\"\"Default implementation of a schema name resolver function\n\"\"\"\n- name = schema.__name__\n+ schema_cls = resolve_schema_cls(schema)\n+ name = schema_cls.__name__\nif name.endswith(\"Schema\"):\nreturn name[:-6] or name\nreturn name\n" }, { "change_type": "MODIFY", "old_path": "src/apispec/ext/marshmallow/openapi.py", "new_path": "src/apispec/ext/marshmallow/openapi.py", "diff": "@@ -461,8 +461,7 @@ class OpenAPIConverter(object):\nschema_instance = resolve_schema_instance(schema)\nschema_key = make_schema_key(schema_instance)\nif schema_key not in self.refs:\n- schema_cls = self.resolve_schema_class(schema)\n- name = self.schema_name_resolver(schema_cls)\n+ name = self.schema_name_resolver(schema)\nif not name:\ntry:\njson_schema = self.schema2jsonschema(schema)\n" }, { "change_type": "MODIFY", "old_path": "tests/test_ext_marshmallow.py", "new_path": "tests/test_ext_marshmallow.py", "diff": "@@ -10,6 +10,7 @@ from marshmallow import Schema\nfrom apispec import APISpec\nfrom apispec.ext.marshmallow import MarshmallowPlugin\nfrom apispec.ext.marshmallow.openapi import MARSHMALLOW_VERSION_INFO\n+from apispec.ext.marshmallow import common\nfrom apispec.exceptions import APISpecError\nfrom .schemas import (\nPetSchema,\n@@ -43,7 +44,8 @@ class TestDefinitionHelper:\[email protected](\"schema\", [AnalysisSchema, AnalysisSchema()])\ndef test_resolve_schema_dict_auto_reference(self, schema):\ndef resolver(schema):\n- return schema.__name__\n+ schema_cls = common.resolve_schema_cls(schema)\n+ return schema_cls.__name__\nspec = APISpec(\ntitle=\"Test auto-reference\",\n@@ -77,7 +79,8 @@ class TestDefinitionHelper:\n)\ndef test_resolve_schema_dict_auto_reference_in_list(self, schema):\ndef resolver(schema):\n- return schema.__name__\n+ schema_cls = common.resolve_schema_cls(schema)\n+ return schema_cls.__name__\nspec = APISpec(\ntitle=\"Test auto-reference\",\n@@ -150,6 +153,32 @@ class TestDefinitionHelper:\npet_exclude = definitions[\"MultiModifierSchema\"][\"properties\"][\"pet_exclude\"]\nassert pet_exclude == build_ref(spec, \"schema\", \"Pet_Exclude\")\n+ def test_schema_instance_with_different_modifers_custom_resolver(self):\n+ class MultiModifierSchema(Schema):\n+ pet_unmodified = Nested(PetSchema)\n+ pet_exclude = Nested(PetSchema(partial=True))\n+\n+ def resolver(schema):\n+ schema_instance = common.resolve_schema_instance(schema)\n+ prefix = \"Partial-\" if schema_instance.partial else \"\"\n+ schema_cls = common.resolve_schema_cls(schema)\n+ name = prefix + schema_cls.__name__\n+ if name.endswith(\"Schema\"):\n+ return name[:-6] or name\n+ return name\n+\n+ spec = APISpec(\n+ title=\"Test Custom Resolver for Partial\",\n+ version=\"0.1\",\n+ openapi_version=\"2.0\",\n+ plugins=(MarshmallowPlugin(schema_name_resolver=resolver),),\n+ )\n+\n+ with pytest.warns(None) as record:\n+ spec.components.schema(\"NameClashSchema\", schema=MultiModifierSchema)\n+\n+ assert len(record) == 0\n+\ndef test_schema_with_clashing_names(self, spec):\nclass Pet(PetSchema):\nanother_field = String()\n" } ]
Python
MIT License
marshmallow-code/apispec
changes schema_name_resolver to accept a schema instance, class, or string
394,000
19.07.2019 17:20:20
14,400
be088ee4a8e047fc0cab7015e67be43c39e759e0
remove unused method Custom resolution of a schema class can now be done directly in a custom schema_name_resolver function
[ { "change_type": "MODIFY", "old_path": "src/apispec/ext/marshmallow/openapi.py", "new_path": "src/apispec/ext/marshmallow/openapi.py", "diff": "@@ -20,7 +20,6 @@ from marshmallow.orderedset import OrderedSet\nfrom apispec.compat import RegexType, iteritems\nfrom apispec.utils import OpenAPIVersion, build_reference\nfrom .common import (\n- resolve_schema_cls,\nget_fields,\nmake_schema_key,\nresolve_schema_instance,\n@@ -721,11 +720,3 @@ class OpenAPIConverter(object):\nreturn schema\nreturn self.resolve_nested_schema(schema)\n-\n- def resolve_schema_class(self, schema):\n- \"\"\"Return schema class for given schema (instance or class)\n-\n- :param type|Schema|str: instance, class or class name of marshmallow.Schema\n- :return: schema class of given schema (instance or class)\n- \"\"\"\n- return resolve_schema_cls(schema)\n" } ]
Python
MIT License
marshmallow-code/apispec
remove unused method Custom resolution of a schema class can now be done directly in a custom schema_name_resolver function
394,000
19.07.2019 18:06:49
14,400
d8800799fb5c32264d26cef7d8b58768142190e1
update documentation on schema_name_resolver
[ { "change_type": "MODIFY", "old_path": "docs/api_ext.rst", "new_path": "docs/api_ext.rst", "diff": "@@ -12,3 +12,8 @@ apispec.ext.marshmallow.openapi\n.. automodule:: apispec.ext.marshmallow.openapi\n:members:\n+\n+apispec.ext.marshmallow.common\n+++++++++++++++++++++++++++++++\n+.. automodule:: apispec.ext.marshmallow.common\n+ :members:\n" }, { "change_type": "MODIFY", "old_path": "docs/using_plugins.rst", "new_path": "docs/using_plugins.rst", "diff": "@@ -214,8 +214,12 @@ function will resolve a name based on the schema's class `__name__`, dropping a\ntrailing \"Schema\" so that `class PetSchema(Schema)` resolves to \"Pet\".\nTo change the behavior of the name resolution simply pass a\n-function accepting a `Schema` class and returning a string to the plugin's\n-constructor. If the `schema_name_resolver` function returns a value that\n+function accepting a `Schema` class, `Schema` instance or a string that resolves\n+to a `Schema` class and returning a string to the plugin's\n+constructor. To easily work with these argument types the marshmallow plugin provides\n+`resolve_schema_cls <apispec.ext.marshmallow.common.resolve_schema_cls>`\n+and `resolve_schema_instance <apispec.ext.marshmallow.common.resolve_schema_instance>`\n+functions. If the `schema_name_resolver` function returns a value that\nevaluates to `False` in a boolean context the nested schema will not be added to\nthe spec and instead defined in-line.\n" }, { "change_type": "MODIFY", "old_path": "src/apispec/ext/marshmallow/__init__.py", "new_path": "src/apispec/ext/marshmallow/__init__.py", "diff": "@@ -76,8 +76,11 @@ class MarshmallowPlugin(BasePlugin):\nExample: ::\n+ from apispec.ext.marshmallow.common import resolve_schema_cls\n+\ndef schema_name_resolver(schema):\n- return schema.__name__\n+ schema_cls = resolve_schema_cls(schema)\n+ return schema_cls.__name__\n\"\"\"\ndef __init__(self, schema_name_resolver=None):\n" } ]
Python
MIT License
marshmallow-code/apispec
update documentation on schema_name_resolver
394,000
22.07.2019 11:43:25
14,400
b63ac081e26883c52c960e5e7f29704e5876f00e
extract functions for Nested List and Dict fields Now passing the ret dictionary to all attribute functions
[ { "change_type": "MODIFY", "old_path": "src/apispec/ext/marshmallow/field_converter.py", "new_path": "src/apispec/ext/marshmallow/field_converter.py", "diff": "@@ -143,34 +143,15 @@ class FieldConverter(object):\nself.field2length,\nself.field2pattern,\nself.metadata2properties,\n+ self.nested2properties,\n+ self.list2properties,\n+ self.dict2properties,\n):\n- ret.update(attr_func(field))\n-\n- if isinstance(field, marshmallow.fields.Nested):\n- del ret[\"type\"]\n- schema_dict = self.resolve_nested_schema(field.schema)\n- if ret and \"$ref\" in schema_dict:\n- ret.update({\"allOf\": [schema_dict]})\n- else:\n- ret.update(schema_dict)\n- elif isinstance(field, marshmallow.fields.List):\n- # field.container was renamed to field.inner in marshmallow 3.0.0rc8\n- inner_field = field.inner if hasattr(field, \"inner\") else field.container\n- ret[\"items\"] = self.field2property(inner_field)\n- elif isinstance(field, marshmallow.fields.Dict):\n- if MARSHMALLOW_VERSION_INFO[0] >= 3:\n- # field.value_container was renamed to field.value_field in marshmallow 3.0.0rc8\n- value_field = (\n- field.value_field\n- if hasattr(field, \"value_field\")\n- else field.value_container\n- )\n- if value_field:\n- ret[\"additionalProperties\"] = self.field2property(value_field)\n+ ret.update(attr_func(field, ret=ret))\nreturn ret\n- def field2type_and_format(self, field):\n+ def field2type_and_format(self, field, **kwargs):\n\"\"\"Return the dictionary of OpenAPI type and format based on the field\ntype\n@@ -199,7 +180,7 @@ class FieldConverter(object):\nreturn ret\n- def field2default(self, field):\n+ def field2default(self, field, **kwargs):\n\"\"\"Return the dictionary containing the field's default value\nWill first look for a `doc_default` key in the field's metadata and then\n@@ -378,7 +359,7 @@ class FieldConverter(object):\nreturn attributes\n- def metadata2properties(self, field):\n+ def metadata2properties(self, field, **kwargs):\n\"\"\"Return a dictionary of properties extracted from field Metadata\nWill include field metadata that are valid properties of `OpenAPI schema\n@@ -408,3 +389,63 @@ class FieldConverter(object):\nif key in _VALID_PROPERTIES or key.startswith(_VALID_PREFIX)\n}\nreturn ret\n+\n+ def nested2properties(self, field, ret):\n+ \"\"\"Return a dictionary of properties from :class:`Nested <marshmallow.fields.Nested`\n+ fields\n+\n+ Typically provides a reference object and will add the schema to the spec\n+ if it is not already present\n+ If a custom `schema_name_resolver` function returns `None` for the nested\n+ schema a JSON schema object will be returned\n+\n+ :param Field field: A marshmallow field.\n+ :rtype: dict\n+ \"\"\"\n+ if isinstance(field, marshmallow.fields.Nested):\n+ del ret[\"type\"]\n+ schema_dict = self.resolve_nested_schema(field.schema)\n+ if ret and \"$ref\" in schema_dict:\n+ ret.update({\"allOf\": [schema_dict]})\n+ else:\n+ ret.update(schema_dict)\n+ return ret\n+\n+ def list2properties(self, field, **kwargs):\n+ \"\"\"Return a dictionary of properties from :class:`List <marshmallow.fields.List`\n+ fields\n+\n+ Will provide an `items` property based on the field's `inner` attribute\n+\n+ :param Field field: A marshmallow field.\n+ :rtype: dict\n+ \"\"\"\n+ ret = {}\n+ if isinstance(field, marshmallow.fields.List):\n+ # field.container was renamed to field.inner in marshmallow 3.0.0rc8\n+ inner_field = field.inner if hasattr(field, \"inner\") else field.container\n+ ret[\"items\"] = self.field2property(inner_field)\n+ return ret\n+\n+ def dict2properties(self, field, **kwargs):\n+ \"\"\"Return a dictionary of properties from :class:`Dict <marshmallow.fields.Dict`\n+ fields\n+\n+ Only applicable for Marshmallow versions greater than 3. Will provide an\n+ `additionalProperties` property based on the field's `value_field` attribute\n+\n+ :param Field field: A marshmallow field.\n+ :rtype: dict\n+ \"\"\"\n+ ret = {}\n+ if isinstance(field, marshmallow.fields.Dict):\n+ if MARSHMALLOW_VERSION_INFO[0] >= 3:\n+ # field.value_container was renamed to field.value_field in marshmallow 3.0.0rc8\n+ value_field = (\n+ field.value_field\n+ if hasattr(field, \"value_field\")\n+ else field.value_container\n+ )\n+ if value_field:\n+ ret[\"additionalProperties\"] = self.field2property(value_field)\n+ return ret\n" } ]
Python
MIT License
marshmallow-code/apispec
extract functions for Nested List and Dict fields Now passing the ret dictionary to all attribute functions
394,000
22.07.2019 13:27:41
14,400
95253eb91f1fd496a65123984d467faa811fd5a6
adds capability for users to add custom attribute converters closes
[ { "change_type": "MODIFY", "old_path": "src/apispec/ext/marshmallow/__init__.py", "new_path": "src/apispec/ext/marshmallow/__init__.py", "diff": "@@ -81,14 +81,17 @@ class MarshmallowPlugin(BasePlugin):\ndef schema_name_resolver(schema):\nschema_cls = resolve_schema_cls(schema)\nreturn schema_cls.__name__\n+ :param tuple attribute_functions: tuple of attribute functions to add to the\n+ builtin collection of attribute functions called on a field\n\"\"\"\n- def __init__(self, schema_name_resolver=None):\n+ def __init__(self, schema_name_resolver=None, attribute_functions=()):\nsuper(MarshmallowPlugin, self).__init__()\nself.schema_name_resolver = schema_name_resolver or resolver\nself.spec = None\nself.openapi_version = None\nself.openapi = None\n+ self.attribute_functions = attribute_functions\ndef init_spec(self, spec):\nsuper(MarshmallowPlugin, self).init_spec(spec)\n@@ -98,6 +101,7 @@ class MarshmallowPlugin(BasePlugin):\nopenapi_version=spec.openapi_version,\nschema_name_resolver=self.schema_name_resolver,\nspec=spec,\n+ attribute_functions=self.attribute_functions,\n)\ndef resolve_parameters(self, parameters):\n" }, { "change_type": "MODIFY", "old_path": "src/apispec/ext/marshmallow/field_converter.py", "new_path": "src/apispec/ext/marshmallow/field_converter.py", "diff": "@@ -89,14 +89,33 @@ class FieldConverter(object):\nShould be in the form '2.x' or '3.x.x' to comply with the OpenAPI standard.\n:param func resolve_nested_schema: callback function from OpenAPIConverter\nto call for nested fields\n+ :param tuple attribute_functions: tuple of attribute functions to add to the\n+ builtin collection of attribute functions called on a field\n\"\"\"\nfield_mapping = DEFAULT_FIELD_MAPPING\n- def __init__(self, openapi_version, resolve_nested_schema):\n+ def __init__(self, openapi_version, resolve_nested_schema, attribute_functions=()):\nself.openapi_version = OpenAPIVersion(openapi_version)\nself.resolve_nested_schema = resolve_nested_schema\n+ builtin_attribute_functions = (\n+ self.field2type_and_format,\n+ self.field2default,\n+ self.field2choices,\n+ self.field2read_only,\n+ self.field2write_only,\n+ self.field2nullable,\n+ self.field2range,\n+ self.field2length,\n+ self.field2pattern,\n+ self.metadata2properties,\n+ self.nested2properties,\n+ self.list2properties,\n+ self.dict2properties,\n+ )\n+ self.attribute_functions = builtin_attribute_functions + attribute_functions\n+\ndef map_to_openapi_type(self, *args):\n\"\"\"Decorator to set mapping for custom fields.\n@@ -132,21 +151,7 @@ class FieldConverter(object):\n\"\"\"\nret = {}\n- for attr_func in (\n- self.field2type_and_format,\n- self.field2default,\n- self.field2choices,\n- self.field2read_only,\n- self.field2write_only,\n- self.field2nullable,\n- self.field2range,\n- self.field2length,\n- self.field2pattern,\n- self.metadata2properties,\n- self.nested2properties,\n- self.list2properties,\n- self.dict2properties,\n- ):\n+ for attr_func in self.attribute_functions:\nret.update(attr_func(field, ret=ret))\nreturn ret\n" }, { "change_type": "MODIFY", "old_path": "src/apispec/ext/marshmallow/openapi.py", "new_path": "src/apispec/ext/marshmallow/openapi.py", "diff": "@@ -46,16 +46,26 @@ class OpenAPIConverter(object):\n:param str|OpenAPIVersion openapi_version: The OpenAPI version to use.\nShould be in the form '2.x' or '3.x.x' to comply with the OpenAPI standard.\n+ :param callable schema_name_resolver: Callable to generate the schema definition name.\n+ Receives the `Schema` class and returns the name to be used in refs within\n+ the generated spec. When working with circular referencing this function\n+ must must not return `None` for schemas in a circular reference chain.\n+ :param APISpec spec: An initalied spec. Nested schemas will be added to the\n+ spec\n+ :param tuple attribute_functions: tuple of attribute functions to add to the\n+ builtin collection of attribute functions called on a field\n\"\"\"\n- def __init__(self, openapi_version, schema_name_resolver, spec):\n+ def __init__(\n+ self, openapi_version, schema_name_resolver, spec, attribute_functions=()\n+ ):\nself.openapi_version = OpenAPIVersion(openapi_version)\nself.schema_name_resolver = schema_name_resolver\nself.spec = spec\n# Schema references\nself.refs = {}\nself.field_converter = FieldConverter(\n- openapi_version, self.resolve_nested_schema\n+ openapi_version, self.resolve_nested_schema, attribute_functions\n)\n@staticmethod\n" }, { "change_type": "MODIFY", "old_path": "tests/test_ext_marshmallow_field.py", "new_path": "tests/test_ext_marshmallow_field.py", "diff": "@@ -4,6 +4,9 @@ import re\nimport pytest\nfrom marshmallow import fields, validate\n+from apispec import APISpec\n+from apispec.ext.marshmallow import MarshmallowPlugin\n+\nfrom .schemas import CategorySchema, CustomList, CustomStringField, CustomIntegerField\nfrom .utils import build_ref\n@@ -269,3 +272,18 @@ def test_nested_field_with_property(spec_fixture):\n\"readOnly\": True,\n\"type\": \"array\",\n}\n+\n+\n+def test_custom_properties_for_custom_fields():\n+ def custom_string2properties(field, **kwargs):\n+ ret = {}\n+ if isinstance(field, CustomStringField):\n+ ret[\"x-customString\"] = True\n+ return ret\n+\n+ ma_plugin = MarshmallowPlugin(attribute_functions=(custom_string2properties,))\n+ APISpec(\n+ title=\"Validation\", version=\"0.1\", openapi_version=\"3.0.0\", plugins=(ma_plugin,)\n+ )\n+ properties = ma_plugin.openapi.field_converter.field2property(CustomStringField())\n+ assert properties[\"x-customString\"]\n" } ]
Python
MIT License
marshmallow-code/apispec
adds capability for users to add custom attribute converters closes #172
394,000
23.07.2019 16:16:21
14,400
707e16de27c77f5bb99dd1e7d8a48191e111859b
changes the mechanism for adding an attribute function
[ { "change_type": "MODIFY", "old_path": "src/apispec/ext/marshmallow/__init__.py", "new_path": "src/apispec/ext/marshmallow/__init__.py", "diff": "@@ -81,17 +81,14 @@ class MarshmallowPlugin(BasePlugin):\ndef schema_name_resolver(schema):\nschema_cls = resolve_schema_cls(schema)\nreturn schema_cls.__name__\n- :param tuple attribute_functions: tuple of attribute functions to add to the\n- builtin collection of attribute functions called on a field\n\"\"\"\n- def __init__(self, schema_name_resolver=None, attribute_functions=()):\n+ def __init__(self, schema_name_resolver=None):\nsuper(MarshmallowPlugin, self).__init__()\nself.schema_name_resolver = schema_name_resolver or resolver\nself.spec = None\nself.openapi_version = None\nself.openapi = None\n- self.attribute_functions = attribute_functions\ndef init_spec(self, spec):\nsuper(MarshmallowPlugin, self).init_spec(spec)\n@@ -101,7 +98,6 @@ class MarshmallowPlugin(BasePlugin):\nopenapi_version=spec.openapi_version,\nschema_name_resolver=self.schema_name_resolver,\nspec=spec,\n- attribute_functions=self.attribute_functions,\n)\ndef resolve_parameters(self, parameters):\n" }, { "change_type": "MODIFY", "old_path": "src/apispec/ext/marshmallow/field_converter.py", "new_path": "src/apispec/ext/marshmallow/field_converter.py", "diff": "@@ -89,17 +89,15 @@ class FieldConverter(object):\nShould be in the form '2.x' or '3.x.x' to comply with the OpenAPI standard.\n:param func resolve_nested_schema: callback function from OpenAPIConverter\nto call for nested fields\n- :param tuple attribute_functions: tuple of attribute functions to add to the\n- builtin collection of attribute functions called on a field\n\"\"\"\nfield_mapping = DEFAULT_FIELD_MAPPING\n- def __init__(self, openapi_version, resolve_nested_schema, attribute_functions=()):\n+ def __init__(self, openapi_version, resolve_nested_schema):\nself.openapi_version = OpenAPIVersion(openapi_version)\nself.resolve_nested_schema = resolve_nested_schema\n- builtin_attribute_functions = (\n+ self.attribute_functions = [\nself.field2type_and_format,\nself.field2default,\nself.field2choices,\n@@ -113,8 +111,7 @@ class FieldConverter(object):\nself.nested2properties,\nself.list2properties,\nself.dict2properties,\n- )\n- self.attribute_functions = builtin_attribute_functions + attribute_functions\n+ ]\ndef map_to_openapi_type(self, *args):\n\"\"\"Decorator to set mapping for custom fields.\n@@ -137,6 +134,17 @@ class FieldConverter(object):\nreturn inner\n+ def add_attribute_function(self, func):\n+ \"\"\"Method to add an attribute function to the list of attribute functions\n+ that will be called on a field to convert it from a field to an OpenAPI\n+ property\n+\n+ :param func func: the attribute function to add - must accept a `field`\n+ positional argument and optionally may accept `self` and `ret`\n+ keyword arguments. Must return a dictionary of properties\n+ \"\"\"\n+ self.attribute_functions.append(functools.partial(func, self=self))\n+\ndef field2property(self, field):\n\"\"\"Return the JSON Schema property definition given a marshmallow\n:class:`Field <marshmallow.fields.Field>`.\n" }, { "change_type": "MODIFY", "old_path": "src/apispec/ext/marshmallow/openapi.py", "new_path": "src/apispec/ext/marshmallow/openapi.py", "diff": "@@ -52,20 +52,16 @@ class OpenAPIConverter(object):\nmust must not return `None` for schemas in a circular reference chain.\n:param APISpec spec: An initalied spec. Nested schemas will be added to the\nspec\n- :param tuple attribute_functions: tuple of attribute functions to add to the\n- builtin collection of attribute functions called on a field\n\"\"\"\n- def __init__(\n- self, openapi_version, schema_name_resolver, spec, attribute_functions=()\n- ):\n+ def __init__(self, openapi_version, schema_name_resolver, spec):\nself.openapi_version = OpenAPIVersion(openapi_version)\nself.schema_name_resolver = schema_name_resolver\nself.spec = spec\n# Schema references\nself.refs = {}\nself.field_converter = FieldConverter(\n- openapi_version, self.resolve_nested_schema, attribute_functions\n+ openapi_version, self.resolve_nested_schema\n)\n@staticmethod\n" }, { "change_type": "MODIFY", "old_path": "tests/test_ext_marshmallow_field.py", "new_path": "tests/test_ext_marshmallow_field.py", "diff": "@@ -281,9 +281,10 @@ def test_custom_properties_for_custom_fields():\nret[\"x-customString\"] = True\nreturn ret\n- ma_plugin = MarshmallowPlugin(attribute_functions=(custom_string2properties,))\n+ ma_plugin = MarshmallowPlugin()\nAPISpec(\ntitle=\"Validation\", version=\"0.1\", openapi_version=\"3.0.0\", plugins=(ma_plugin,)\n)\n+ ma_plugin.openapi.field_converter.add_attribute_function(custom_string2properties)\nproperties = ma_plugin.openapi.field_converter.field2property(CustomStringField())\nassert properties[\"x-customString\"]\n" } ]
Python
MIT License
marshmallow-code/apispec
changes the mechanism for adding an attribute function
394,000
30.08.2019 11:58:46
14,400
ed5894aff14ce2a4db42c1a0c9ea9e7d96c980b7
enhance documentation for adding custom attribute functions
[ { "change_type": "MODIFY", "old_path": "docs/api_ext.rst", "new_path": "docs/api_ext.rst", "diff": "@@ -13,6 +13,12 @@ apispec.ext.marshmallow.openapi\n.. automodule:: apispec.ext.marshmallow.openapi\n:members:\n+apispec.ext.marshmallow.field_converter\n++++++++++++++++++++++++++++++++++++++++\n+\n+.. automodule:: apispec.ext.marshmallow.field_converter\n+ :members:\n+\napispec.ext.marshmallow.common\n++++++++++++++++++++++++++++++\n.. automodule:: apispec.ext.marshmallow.common\n" }, { "change_type": "MODIFY", "old_path": "docs/using_plugins.rst", "new_path": "docs/using_plugins.rst", "diff": "@@ -252,6 +252,9 @@ OpenAPI type and format, or a marshmallow `Field` that has the desired target ma\nma_plugin = MarshmallowPlugin()\n+ spec = APISpec(\n+ title=\"Demo\", version=\"0.1\", openapi_version=\"3.0.0\", plugins=(ma_plugin,)\n+ )\n# Inherits Integer mapping of ('integer', 'int32')\nclass MyCustomInteger(Integer):\n@@ -268,7 +271,24 @@ OpenAPI type and format, or a marshmallow `Field` that has the desired target ma\nclass MyCustomFieldThatsKindaLikeAnInteger(Field):\npass\n+In situations where greater control of the properties generated for a custom field\n+is desired, users may add custom logic to the conversion of fields to OpenAPI properties\n+through the use of the `add_attribute_function\n+<apispec.ext.marshmallow.field_converter.FieldConverterMixin.add_attribute_function>`\n+method. Continuing from the example above:\n+\n+.. code-block:: python\n+\n+ def my_custom_field2properties(field, **kwargs):\n+ \"\"\"Add an OpenAPI extension flag to MyCustomField instances\n+ \"\"\"\n+ ret = {}\n+ if isinstance(field, MyCustomField):\n+ ret[\"x-customField\"] = True\n+ return ret\n+\n+ ma_plugin.openapi.add_attribute_function(my_custom_field2properties)\nNext Steps\n----------\n" }, { "change_type": "MODIFY", "old_path": "src/apispec/ext/marshmallow/field_converter.py", "new_path": "src/apispec/ext/marshmallow/field_converter.py", "diff": "@@ -129,9 +129,16 @@ class FieldConverterMixin(object):\nthat will be called on a field to convert it from a field to an OpenAPI\nproperty\n- :param func func: the attribute function to add - must accept a `field`\n- positional argument and optionally may accept `self` and `ret`\n- keyword arguments. Must return a dictionary of properties\n+ :param func func: the attribute function to add - will be called for each\n+ field in a schema with a `field <marshmallow.fields.Field>` instance\n+ positional argument and `self <apispec.ext.marshmallow.openapi.OpenAPIConverter>`\n+ and `ret <dict>` keyword arguments.\n+ Must return a dictionary of OpenAPI properties that will be shallow\n+ merged with the return values of all other attribute functions called on the field.\n+ User added attribute functions will be called after all built-in attribute\n+ functions in the order they were added. The merged results of all\n+ previously called attribute functions are accessable via the `ret`\n+ argument.\n\"\"\"\nself.attribute_functions.append(functools.partial(func, self=self))\n" } ]
Python
MIT License
marshmallow-code/apispec
enhance documentation for adding custom attribute functions
394,000
30.08.2019 14:16:57
14,400
137813b123ce3f4990b713ae2cb4aeadec0c5739
add note on add_attribute_function to changelog
[ { "change_type": "MODIFY", "old_path": "CHANGELOG.rst", "new_path": "CHANGELOG.rst", "diff": "@@ -6,6 +6,8 @@ Changelog\nFeatures:\n+- Add support for generating user defined OpenAPI properties for custom field\n+ classes via an ``add_attribute_function`` method. (:pr:`478`)\n- *Backwards-incompatible*: The ``schema_name_resolver`` function now receives\na ``Schema`` class, a ``Schema`` instance or a string that resolves to a\n``Schema`` class. This allows a custom resolver to generate different names\n" } ]
Python
MIT License
marshmallow-code/apispec
add note on add_attribute_function to changelog
394,000
03.09.2019 22:47:11
14,400
fc5a040e0a1a24e0191ef82dd03f06ad099b78f1
changes Marshmallow fields.Raw and fields.Field to Any Type closes
[ { "change_type": "MODIFY", "old_path": "src/apispec/ext/marshmallow/field_converter.py", "new_path": "src/apispec/ext/marshmallow/field_converter.py", "diff": "@@ -37,9 +37,8 @@ DEFAULT_FIELD_MAPPING = {\nmarshmallow.fields.Email: (\"string\", \"email\"),\nmarshmallow.fields.URL: (\"string\", \"url\"),\nmarshmallow.fields.Dict: (\"object\", None),\n- # Assume base Field and Raw are strings\n- marshmallow.fields.Field: (\"string\", None),\n- marshmallow.fields.Raw: (\"string\", None),\n+ marshmallow.fields.Field: (None, None),\n+ marshmallow.fields.Raw: (None, None),\nmarshmallow.fields.List: (\"array\", None),\n}\n@@ -183,8 +182,9 @@ class FieldConverterMixin:\n)\ntype_, fmt = \"string\", None\n- ret = {\"type\": type_}\n-\n+ ret = {}\n+ if type_:\n+ ret[\"type\"] = type_\nif fmt:\nret[\"format\"] = fmt\n@@ -413,7 +413,6 @@ class FieldConverterMixin:\n:rtype: dict\n\"\"\"\nif isinstance(field, marshmallow.fields.Nested):\n- del ret[\"type\"]\nschema_dict = self.resolve_nested_schema(field.schema)\nif ret and \"$ref\" in schema_dict:\nret.update({\"allOf\": [schema_dict]})\n" }, { "change_type": "MODIFY", "old_path": "tests/test_ext_marshmallow_field.py", "new_path": "tests/test_ext_marshmallow_field.py", "diff": "@@ -34,9 +34,6 @@ def test_field2choices_preserving_order(openapi):\n(fields.Time, \"string\"),\n(fields.Email, \"string\"),\n(fields.URL, \"string\"),\n- # Assume base Field and Raw are strings\n- (fields.Field, \"string\"),\n- (fields.Raw, \"string\"),\n# Custom fields inherit types from their parents\n(CustomStringField, \"string\"),\n(CustomIntegerField, \"integer\"),\n@@ -48,6 +45,13 @@ def test_field2property_type(FieldClass, jsontype, spec_fixture):\nassert res[\"type\"] == jsontype\[email protected](\"FieldClass\", [fields.Field, fields.Raw])\n+def test_field2property_no_type_(FieldClass, spec_fixture):\n+ field = FieldClass()\n+ res = spec_fixture.openapi.field2property(field)\n+ assert \"type\" not in res\n+\n+\[email protected](\"ListClass\", [fields.List, CustomList])\ndef test_formatted_field_translates_to_array(ListClass, spec_fixture):\nfield = ListClass(fields.String)\n" } ]
Python
MIT License
marshmallow-code/apispec
changes Marshmallow fields.Raw and fields.Field to Any Type closes #395
394,000
04.09.2019 22:28:37
14,400
c41b4de5310306320aa2b3d3154954c90442616e
extracts logic for resolving schemas in OpenAPI objects Enhannces documentation
[ { "change_type": "MODIFY", "old_path": "docs/api_ext.rst", "new_path": "docs/api_ext.rst", "diff": "@@ -7,6 +7,12 @@ apispec.ext.marshmallow\n.. automodule:: apispec.ext.marshmallow\n:members:\n+apispec.ext.marshmallow.schema_resolver\n++++++++++++++++++++++++++++++++++++++++\n+\n+.. automodule:: apispec.ext.marshmallow.schema_resolver\n+ :members:\n+\napispec.ext.marshmallow.openapi\n+++++++++++++++++++++++++++++++\n" }, { "change_type": "MODIFY", "old_path": "src/apispec/ext/marshmallow/__init__.py", "new_path": "src/apispec/ext/marshmallow/__init__.py", "diff": "@@ -73,6 +73,7 @@ import warnings\nfrom apispec import BasePlugin\nfrom .common import resolve_schema_instance, make_schema_key, resolve_schema_cls\nfrom .openapi import OpenAPIConverter\n+from .schema_resolver import SchemaResolver\ndef resolver(schema):\n@@ -102,6 +103,7 @@ class MarshmallowPlugin(BasePlugin):\n\"\"\"\nConverter = OpenAPIConverter\n+ Resolver = SchemaResolver\ndef __init__(self, schema_name_resolver=None):\nsuper().__init__()\n@@ -109,6 +111,7 @@ class MarshmallowPlugin(BasePlugin):\nself.spec = None\nself.openapi_version = None\nself.converter = None\n+ self.resolver = None\ndef init_spec(self, spec):\nsuper().init_spec(spec)\n@@ -119,54 +122,8 @@ class MarshmallowPlugin(BasePlugin):\nschema_name_resolver=self.schema_name_resolver,\nspec=spec,\n)\n-\n- def resolve_parameters(self, parameters):\n- resolved = []\n- for parameter in parameters:\n- if (\n- isinstance(parameter, dict)\n- and not isinstance(parameter.get(\"schema\", {}), dict)\n- and \"in\" in parameter\n- ):\n- schema_instance = resolve_schema_instance(parameter.pop(\"schema\"))\n- resolved += self.converter.schema2parameters(\n- schema_instance, default_in=parameter.pop(\"in\"), **parameter\n- )\n- else:\n- self.resolve_schema(parameter)\n- resolved.append(parameter)\n- return resolved\n-\n- def resolve_schema_in_request_body(self, request_body):\n- \"\"\"Function to resolve a schema in a requestBody object - modifies then\n- response dict to convert Marshmallow Schema object or class into dict\n- \"\"\"\n- content = request_body[\"content\"]\n- for content_type in content:\n- schema = content[content_type][\"schema\"]\n- content[content_type][\"schema\"] = self.converter.resolve_schema_dict(schema)\n-\n- def resolve_schema(self, data):\n- \"\"\"Function to resolve a schema in a parameter or response - modifies the\n- corresponding dict to convert Marshmallow Schema object or class into dict\n-\n- :param APISpec spec: `APISpec` containing refs.\n- :param dict|str data: either a parameter or response dictionary that may\n- contain a schema, or a reference provided as string\n- \"\"\"\n- if not isinstance(data, dict):\n- return\n-\n- # OAS 2 component or OAS 3 header\n- if \"schema\" in data:\n- data[\"schema\"] = self.converter.resolve_schema_dict(data[\"schema\"])\n- # OAS 3 component except header\n- if self.openapi_version.major >= 3:\n- if \"content\" in data:\n- for content in data[\"content\"].values():\n- if \"schema\" in content:\n- content[\"schema\"] = self.converter.resolve_schema_dict(\n- content[\"schema\"]\n+ self.resolver = self.Resolver(\n+ openapi_version=spec.openapi_version, converter=self.converter\n)\ndef map_to_openapi_type(self, *args):\n@@ -217,7 +174,7 @@ class MarshmallowPlugin(BasePlugin):\nSchema class or instance.\n\"\"\"\n# In OpenAPIv3, this only works when using the complex form using \"content\"\n- self.resolve_schema(parameter)\n+ self.resolver.resolve_schema(parameter)\nreturn parameter\ndef response_helper(self, response, **kwargs):\n@@ -227,10 +184,7 @@ class MarshmallowPlugin(BasePlugin):\n:param dict parameter: response fields. May contain a marshmallow\nSchema class or instance.\n\"\"\"\n- self.resolve_schema(response)\n- if \"headers\" in response:\n- for header in response[\"headers\"].values():\n- self.resolve_schema(header)\n+ self.resolver.resolve_response(response)\nreturn response\ndef operation_helper(self, operations, **kwargs):\n@@ -238,17 +192,14 @@ class MarshmallowPlugin(BasePlugin):\nif not isinstance(operation, dict):\ncontinue\nif \"parameters\" in operation:\n- operation[\"parameters\"] = self.resolve_parameters(\n+ operation[\"parameters\"] = self.resolver.resolve_parameters(\noperation[\"parameters\"]\n)\nif self.openapi_version.major >= 3:\nif \"requestBody\" in operation:\n- self.resolve_schema_in_request_body(operation[\"requestBody\"])\n+ self.resolver.resolve_schema(operation[\"requestBody\"])\nfor response in operation.get(\"responses\", {}).values():\n- self.resolve_schema(response)\n- if \"headers\" in response:\n- for header in response[\"headers\"].values():\n- self.resolve_schema(header)\n+ self.resolver.resolve_response(response)\ndef warn_if_schema_already_in_spec(self, schema_key):\n\"\"\"Method to warn the user if the schema has already been added to the\n" }, { "change_type": "MODIFY", "old_path": "src/apispec/ext/marshmallow/openapi.py", "new_path": "src/apispec/ext/marshmallow/openapi.py", "diff": "@@ -120,7 +120,7 @@ class OpenAPIConverter(FieldConverterMixin):\n\"\"\"\nopenapi_default_in = __location_map__.get(default_in, default_in)\nif self.openapi_version.major < 3 and openapi_default_in == \"body\":\n- prop = self.resolve_schema_dict(schema)\n+ prop = self.resolve_nested_schema(schema)\nparam = {\n\"in\": openapi_default_in,\n@@ -314,16 +314,3 @@ class OpenAPIConverter(FieldConverterMixin):\nif getattr(schema, \"many\", False):\nreturn {\"type\": \"array\", \"items\": ref_schema}\nreturn ref_schema\n-\n- def resolve_schema_dict(self, schema):\n- if isinstance(schema, dict):\n- if schema.get(\"type\") == \"array\" and \"items\" in schema:\n- schema[\"items\"] = self.resolve_schema_dict(schema[\"items\"])\n- if schema.get(\"type\") == \"object\" and \"properties\" in schema:\n- schema[\"properties\"] = {\n- k: self.resolve_schema_dict(v)\n- for k, v in schema[\"properties\"].items()\n- }\n- return schema\n-\n- return self.resolve_nested_schema(schema)\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/apispec/ext/marshmallow/schema_resolver.py", "diff": "+from .common import resolve_schema_instance\n+\n+\n+class SchemaResolver:\n+ \"\"\"Resolve Marshmallow Schemas in OpenAPI components and translate to OpenAPI\n+ `schema objects\n+ <https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#schema-object>`_,\n+ `parameter objects\n+ <https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#parameter-object>`_\n+ or `reference objects\n+ <https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#reference-object>`_.\n+ \"\"\"\n+\n+ def __init__(self, openapi_version, converter):\n+ self.openapi_version = openapi_version\n+ self.converter = converter\n+\n+ def resolve_parameters(self, parameters):\n+ \"\"\"Resolve Marshmallow Schemas in a list of OpenAPI `Parameter Objects\n+ <https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#parameter-object>`_.\n+ Each parameter object that contains a Schema will be translated into\n+ one or more Parameter Objects.\n+\n+ If the value of a `schema` key is Marshmallow Schema class, instance or\n+ a string that resolves to a Schema Class each field in the Schema will\n+ be expanded as a seperate Parameter Object.\n+\n+ Example: ::\n+\n+ #Input\n+ class UserSchema(Schema):\n+ name = fields.String()\n+ id = fields.Int()\n+\n+ [\n+ {\"in\": \"query\", \"schema\": \"UserSchema\"}\n+ ]\n+\n+ #Output\n+ [\n+ {\"in\": \"query\", \"name\": \"id\", \"required\": False, \"schema\": {\"type\": \"integer\", \"format\": \"int32\"}},\n+ {\"in\": \"query\", \"name\": \"name\", \"required\": False, \"schema\": {\"type\": \"string\"}}\n+ ]\n+\n+ If the Parameter Object contains a `content` key a single Parameter\n+ Object is returned with the Schema translated into a Schema Object or\n+ Reference Object.\n+\n+ Example: ::\n+\n+ #Input\n+ [{\"in\": \"query\", \"name\": \"pet\", \"content\":{\"application/json\": {\"schema\": \"PetSchema\"}} }]\n+\n+ #Output\n+ [\n+ {\n+ \"in\": \"query\",\n+ \"name\": \"pet\",\n+ \"content\": {\n+ \"application/json\": {\n+ \"schema\": {\"$ref\": \"#/components/schemas/Pet\"}\n+ }\n+ }\n+ }\n+ ]\n+\n+\n+ :param list parameters: the list of OpenAPI parameter objects to resolve.\n+ \"\"\"\n+ resolved = []\n+ for parameter in parameters:\n+ if (\n+ isinstance(parameter, dict)\n+ and not isinstance(parameter.get(\"schema\", {}), dict)\n+ and \"in\" in parameter\n+ ):\n+ schema_instance = resolve_schema_instance(parameter.pop(\"schema\"))\n+ resolved += self.converter.schema2parameters(\n+ schema_instance, default_in=parameter.pop(\"in\"), **parameter\n+ )\n+ else:\n+ self.resolve_schema(parameter)\n+ resolved.append(parameter)\n+ return resolved\n+\n+ def resolve_response(self, response):\n+ \"\"\"Resolve Marshmallow Schemas in OpenAPI `Response Objects\n+ <https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#responseObject>`_.\n+ Schemas may appear in either a Media Type Object or a Header Object.\n+\n+ Example: ::\n+\n+ #Input\n+ {\n+ \"content\": {\"application/json\": {\"schema\": \"PetSchema\"}},\n+ \"description\": \"successful operation\",\n+ \"headers\": {\"PetHeader\": {\"schema\": \"PetHeaderSchema\"}},\n+ }\n+\n+ #Output\n+ {\n+ \"content\": {\n+ \"application/json\":{\"schema\": {\"$ref\": \"#/components/schemas/Pet\"}}\n+ },\n+ \"description\": \"successful operation\",\n+ \"headers\": {\n+ \"PetHeader\": {\"schema\": {\"$ref\": \"#/components/schemas/PetHeader\"}}\n+ },\n+ }\n+\n+ :param dict response: the response object to resolve.\n+ \"\"\"\n+ self.resolve_schema(response)\n+ if \"headers\" in response:\n+ for header in response[\"headers\"].values():\n+ self.resolve_schema(header)\n+\n+ def resolve_schema(self, data):\n+ \"\"\"Resolve Marshmallow Schemas in an OpenAPI component or header -\n+ modifies the input dictionary to translate Marshmallow Schemas to OpenAPI\n+ Schema Objects or Reference Objects.\n+\n+ OpenAPIv3 Components: ::\n+\n+ #Input\n+ {\n+ \"description\": \"user to add to the system\",\n+ \"content\": {\n+ \"application/json\": {\n+ \"schema\": \"UserSchema\"\n+ }\n+ }\n+ }\n+\n+ #Output\n+ {\n+ \"description\": \"user to add to the system\",\n+ \"content\": {\n+ \"application/json\": {\n+ \"schema\": {\n+ \"$ref\": \"#/components/schemas/User\"\n+ }\n+ }\n+ }\n+ }\n+\n+ :param dict|str data: either a parameter or response dictionary that may\n+ contain a schema, or a reference provided as string\n+ \"\"\"\n+ if not isinstance(data, dict):\n+ return\n+\n+ # OAS 2 component or OAS 3 header\n+ if \"schema\" in data:\n+ data[\"schema\"] = self.resolve_schema_dict(data[\"schema\"])\n+ # OAS 3 component except header\n+ if self.openapi_version.major >= 3:\n+ if \"content\" in data:\n+ for content in data[\"content\"].values():\n+ if \"schema\" in content:\n+ content[\"schema\"] = self.resolve_schema_dict(content[\"schema\"])\n+\n+ def resolve_schema_dict(self, schema):\n+ \"\"\"Resolve a Marshmallow Schema class, object, or a string that resolves\n+ to a Schema class or an OpenAPI Schema Object containing one of the above\n+ to an OpenAPI Schema Object or Reference Object.\n+\n+ If the input is a Marshmallow Schema class, object or a string that resolves\n+ to a Schema class the Schema will be translated to an OpenAPI Schema Object\n+ or Reference Object.\n+\n+ Example: ::\n+\n+ #Input\n+ \"PetSchema\"\n+\n+ #Output\n+ {\"$ref\": \"#/components/schemas/Pet\"}\n+\n+ If the input is a dictionary representation of an OpenAPI Schema Object\n+ recursively search for a Marshmallow Schemas to resolve. For `\"type\": \"array\"`,\n+ Marshmallow Schemas may appear as the value of the `items` key. For\n+ `\"type\": \"object\"` Marshmalow Schemas may appear as values in the `properties`\n+ dictionary.\n+\n+ Examples: ::\n+\n+ #Input\n+ {\"type\": \"array\", \"items\": \"PetSchema\"}\n+\n+ #Output\n+ {\"type\": \"array\", \"items\": {\"$ref\": \"#/components/schemas/Pet\"}}\n+\n+ #Input\n+ {\"type\": \"object\", \"properties\": {\"pet\": \"PetSchcema\", \"user\": \"UserSchema\"}}\n+\n+ #Output\n+ {\n+ \"type\": \"object\",\n+ \"properties\": {\n+ \"pet\": {\"$ref\": \"#/components/schemas/Pet\"},\n+ \"user\": {\"$ref\": \"#/components/schemas/User\"}\n+ }\n+ }\n+\n+ :param string|Schema|dict schema: the schema to resolve.\n+ \"\"\"\n+ if isinstance(schema, dict):\n+ if schema.get(\"type\") == \"array\" and \"items\" in schema:\n+ schema[\"items\"] = self.resolve_schema_dict(schema[\"items\"])\n+ if schema.get(\"type\") == \"object\" and \"properties\" in schema:\n+ schema[\"properties\"] = {\n+ k: self.resolve_schema_dict(v)\n+ for k, v in schema[\"properties\"].items()\n+ }\n+ return schema\n+\n+ return self.converter.resolve_nested_schema(schema)\n" }, { "change_type": "MODIFY", "old_path": "tests/test_ext_marshmallow.py", "new_path": "tests/test_ext_marshmallow.py", "diff": "@@ -477,7 +477,9 @@ class TestOperationHelper:\nname = parameter[\"name\"]\nassert description == PetSchema.description[name]\npost = p[\"post\"]\n- post_schema = spec_fixture.openapi.resolve_schema_dict(PetSchema)\n+ post_schema = spec_fixture.marshmallow_plugin.resolver.resolve_schema_dict(\n+ PetSchema\n+ )\nassert (\npost[\"requestBody\"][\"content\"][\"application/json\"][\"schema\"] == post_schema\n)\n" } ]
Python
MIT License
marshmallow-code/apispec
extracts logic for resolving schemas in OpenAPI objects Enhannces documentation
394,009
04.11.2019 02:29:14
-19,080
167a73ea89f6937c8fd61ae2d459e00f296fcccf
Added example support Added tests Completes a Todo
[ { "change_type": "MODIFY", "old_path": "AUTHORS.rst", "new_path": "AUTHORS.rst", "diff": "@@ -59,3 +59,4 @@ Contributors (chronological)\n- Dave `@zedrdave <https://github.com/zedrdave>`_\n- Emmanuel Valette `@karec <https://github.com/karec/>`_\n- Hugo van Kemenade `@hugovk <https://github.com/hugovk>`_\n+- Ashutosh Chaudhary `@codeasashu <https://github.com/codeasashu>`_\n" }, { "change_type": "MODIFY", "old_path": "src/apispec/core.py", "new_path": "src/apispec/core.py", "diff": "@@ -30,12 +30,14 @@ class Components:\nself._plugins = plugins\nself.openapi_version = openapi_version\nself._schemas = {}\n+ self._examples = {}\nself._parameters = {}\nself._responses = {}\nself._security_schemes = {}\ndef to_dict(self):\nsubsections = {\n+ \"example\": self._examples,\n\"schema\": self._schemas,\n\"parameter\": self._parameters,\n\"response\": self._responses,\n@@ -47,6 +49,21 @@ class Components:\nif v != {}\n}\n+ def example(self, name, component, **kwargs):\n+ \"\"\"Add an example which can be referenced\n+\n+ :param str name: identifier by which example may be referenced.\n+ :param dict component: example fields.\n+\n+ https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#exampleObject\n+ \"\"\"\n+ if name in self._examples:\n+ raise DuplicateComponentNameError(\n+ 'Another example with name \"{}\" is already registered.'.format(name)\n+ )\n+ self._examples[name] = component\n+ return self\n+\ndef schema(self, name, component=None, **kwargs):\n\"\"\"Add a new schema to the spec.\n" }, { "change_type": "MODIFY", "old_path": "src/apispec/utils.py", "new_path": "src/apispec/utils.py", "diff": "@@ -17,6 +17,7 @@ COMPONENT_SUBSECTIONS = {\n\"security_scheme\": \"securityDefinitions\",\n},\n3: {\n+ \"example\": \"examples\",\n\"schema\": \"schemas\",\n\"parameter\": \"parameters\",\n\"response\": \"responses\",\n" }, { "change_type": "MODIFY", "old_path": "tests/test_core.py", "new_path": "tests/test_core.py", "diff": "@@ -14,6 +14,7 @@ from apispec.exceptions import (\nfrom .utils import (\nget_schemas,\n+ get_examples,\nget_paths,\nget_parameters,\nget_responses,\n@@ -137,6 +138,13 @@ class TestComponents:\n\"name\": {\"type\": \"string\", \"example\": \"doggie\"},\n}\n+ # Referenced examples are only supported in OAS 3.x\n+ @pytest.mark.parametrize(\"spec\", (\"3.0.0\",), indirect=True)\n+ def test_example(self, spec):\n+ spec.components.example(\"PetExample\", {\"value\": {\"a\": \"b\"}})\n+ defs = get_examples(spec)\n+ assert defs[\"PetExample\"][\"value\"] == {\"a\": \"b\"}\n+\ndef test_schema(self, spec):\nspec.components.schema(\"Pet\", {\"properties\": self.properties})\ndefs = get_schemas(spec)\n" }, { "change_type": "MODIFY", "old_path": "tests/utils.py", "new_path": "tests/utils.py", "diff": "from apispec.utils import build_reference\n+def get_examples(spec):\n+ return spec.to_dict()[\"components\"][\"examples\"]\n+\n+\ndef get_schemas(spec):\nif spec.openapi_version.major < 3:\nreturn spec.to_dict()[\"definitions\"]\n" } ]
Python
MIT License
marshmallow-code/apispec
Added example support Added tests Completes a #245 Todo
394,011
06.11.2019 00:12:59
-3,600
b853a394386a3e601a4030dd933d16b8e931dc5b
Update main example so that it can run smoothly
[ { "change_type": "MODIFY", "old_path": "AUTHORS.rst", "new_path": "AUTHORS.rst", "diff": "@@ -59,4 +59,5 @@ Contributors (chronological)\n- Dave `@zedrdave <https://github.com/zedrdave>`_\n- Emmanuel Valette `@karec <https://github.com/karec/>`_\n- Hugo van Kemenade `@hugovk <https://github.com/hugovk>`_\n+- Bastien Gerard `@bagerard <https://github.com/bagerard>`_\n- Ashutosh Chaudhary `@codeasashu <https://github.com/codeasashu>`_\n" }, { "change_type": "MODIFY", "old_path": "docs/index.rst", "new_path": "docs/index.rst", "diff": "@@ -19,6 +19,8 @@ Example Application\n.. code-block:: python\n+ import uuid\n+\nfrom apispec import APISpec\nfrom apispec.ext.marshmallow import MarshmallowPlugin\nfrom apispec_webframeworks.flask import FlaskPlugin\n@@ -41,7 +43,7 @@ Example Application\nclass PetSchema(Schema):\n- category = fields.List(fields.Nested(CategorySchema))\n+ categories = fields.List(fields.Nested(CategorySchema))\nname = fields.Str()\n@@ -57,12 +59,17 @@ Example Application\ndescription: Get a random pet\nresponses:\n200:\n+ description: Return a pet\ncontent:\napplication/json:\nschema: PetSchema\n\"\"\"\n- pet = get_random_pet()\n- return PetSchema().dump(pet)\n+ # Hardcoded example data\n+ pet_data = {\n+ \"name\": \"sample_pet_\" + str(uuid.uuid1()),\n+ \"categories\": [{\"id\": 1, \"name\": \"sample_category\"}],\n+ }\n+ return PetSchema().dump(pet_data)\n# Register the path and the entities within it\n@@ -79,43 +86,22 @@ Generated OpenAPI Spec\nprint(json.dumps(spec.to_dict(), indent=2))\n# {\n- # \"paths\": {\n- # \"/random\": {\n- # \"get\": {\n- # \"description\": \"Get a random pet\",\n- # \"responses\": {\n- # \"200\": {\n- # \"content\": {\n- # \"application/json\": {\n- # \"schema\": {\n- # \"$ref\": \"#/components/schemas/Pet\"\n- # }\n- # }\n- # }\n- # }\n- # }\n- # }\n- # }\n- # },\n- # \"tags\": [],\n# \"info\": {\n# \"title\": \"Swagger Petstore\",\n# \"version\": \"1.0.0\"\n# },\n# \"openapi\": \"3.0.2\",\n# \"components\": {\n- # \"parameters\": {},\n- # \"responses\": {},\n# \"schemas\": {\n# \"Category\": {\n# \"type\": \"object\",\n# \"properties\": {\n- # \"name\": {\n- # \"type\": \"string\"\n- # },\n# \"id\": {\n# \"type\": \"integer\",\n# \"format\": \"int32\"\n+ # },\n+ # \"name\": {\n+ # \"type\": \"string\"\n# }\n# },\n# \"required\": [\n@@ -125,51 +111,77 @@ Generated OpenAPI Spec\n# \"Pet\": {\n# \"type\": \"object\",\n# \"properties\": {\n- # \"name\": {\n- # \"type\": \"string\"\n- # },\n- # \"category\": {\n+ # \"categories\": {\n# \"type\": \"array\",\n# \"items\": {\n# \"$ref\": \"#/components/schemas/Category\"\n# }\n+ # },\n+ # \"name\": {\n+ # \"type\": \"string\"\n# }\n# }\n# }\n# }\n+ # },\n+ # \"paths\": {\n+ # \"/random\": {\n+ # \"get\": {\n+ # \"description\": \"Get a random pet\",\n+ # \"responses\": {\n+ # \"200\": {\n+ # \"description\": \"Return a pet\",\n+ # \"content\": {\n+ # \"application/json\": {\n+ # \"schema\": {\n+ # \"$ref\": \"#/components/schemas/Pet\"\n+ # }\n+ # }\n+ # }\n# }\n# }\n+ # }\n+ # }\n+ # },\n+ # }\nprint(spec.to_yaml())\n+ # info:\n+ # title: Swagger Petstore\n+ # version: 1.0.0\n+ # openapi: 3.0.2\n# components:\n- # parameters: {}\n- # responses: {}\n# schemas:\n# Category:\n# properties:\n- # id: {format: int32, type: integer}\n- # name: {type: string}\n- # required: [name]\n+ # id:\n+ # format: int32\n+ # type: integer\n+ # name:\n+ # type: string\n+ # required:\n+ # - name\n# type: object\n# Pet:\n# properties:\n- # category:\n- # items: {$ref: '#/components/schemas/Category'}\n+ # categories:\n+ # items:\n+ # $ref: '#/components/schemas/Category'\n# type: array\n- # name: {type: string}\n+ # name:\n+ # type: string\n# type: object\n- # info: {title: Swagger Petstore, version: 1.0.0}\n- # openapi: 3.0.2\n# paths:\n# /random:\n# get:\n# description: Get a random pet\n# responses:\n- # 200:\n+ # '200':\n# content:\n# application/json:\n- # schema: {$ref: '#/components/schemas/Pet'}\n- # tags: []\n+ # schema:\n+ # $ref: '#/components/schemas/Pet'\n+ # description: Return a pet\nUser Guide\n==========\n" } ]
Python
MIT License
marshmallow-code/apispec
Update main example so that it can run smoothly (#513)
394,024
12.02.2020 17:46:06
-3,600
686bc1f8f50a1f6530c927a23c5e0ba0e6c39d59
Add Colin Bounouar to contributors
[ { "change_type": "MODIFY", "old_path": "AUTHORS.rst", "new_path": "AUTHORS.rst", "diff": "@@ -62,3 +62,4 @@ Contributors (chronological)\n- Bastien Gerard `@bagerard <https://github.com/bagerard>`_\n- Ashutosh Chaudhary `@codeasashu <https://github.com/codeasashu>`_\n- Fedor Fominykh `@fedorfo <https://github.com/fedorfo>`_\n+- Colin Bounouar `@Colin-b <https://github.com/colin-b>`_\n" } ]
Python
MIT License
marshmallow-code/apispec
Add Colin Bounouar to contributors
394,024
12.02.2020 17:47:41
-3,600
a477aff711f634bc85d986dc0f31e6e866c620e6
Allow to access components in plugins init_spec method
[ { "change_type": "MODIFY", "old_path": "src/apispec/core.py", "new_path": "src/apispec/core.py", "diff": "@@ -190,19 +190,19 @@ class APISpec:\nself.version = version\nself.openapi_version = OpenAPIVersion(openapi_version)\nself.options = options\n+ self.plugins = plugins\n# Metadata\nself._tags = []\nself._paths = OrderedDict()\n+ # Components\n+ self.components = Components(self.plugins, self.openapi_version)\n+\n# Plugins\n- self.plugins = plugins\nfor plugin in self.plugins:\nplugin.init_spec(self)\n- # Components\n- self.components = Components(self.plugins, self.openapi_version)\n-\ndef to_dict(self):\nret = {\n\"paths\": self._paths,\n" }, { "change_type": "MODIFY", "old_path": "tests/test_core.py", "new_path": "tests/test_core.py", "diff": "@@ -276,6 +276,19 @@ class TestComponents:\nspec.components.schema(\"Pet\", properties=self.properties, enum=enum)\nassert spec.to_dict() == yaml.safe_load(spec.to_yaml())\n+ def test_components_can_be_accessed_by_plugin_in_init_spec(self):\n+ class TestPlugin(BasePlugin):\n+ def init_spec(self, spec):\n+ spec.components.schema(\n+ \"TestSchema\", {\"properties\": {\"key\": {\"type\": \"string\"}}, \"type\": \"object\"}\n+ )\n+\n+ spec = APISpec(\"Test API\", version=\"0.0.1\", openapi_version=\"2.0\", plugins=[TestPlugin()])\n+ metadata = spec.to_dict()\n+ assert metadata[\"definitions\"] == {\n+ 'TestSchema': {'properties': {'key': {'type': 'string'}}, 'type': 'object'}\n+ }\n+\nclass TestPath:\npaths = {\n" } ]
Python
MIT License
marshmallow-code/apispec
Allow to access components in plugins init_spec method
394,024
12.02.2020 18:20:55
-3,600
cca8ccbc26abc0cb9b524655137b414e4c650abc
Apply flake8 and black formatting Use helper to retrieve schemas
[ { "change_type": "MODIFY", "old_path": "tests/test_core.py", "new_path": "tests/test_core.py", "diff": "@@ -280,13 +280,15 @@ class TestComponents:\nclass TestPlugin(BasePlugin):\ndef init_spec(self, spec):\nspec.components.schema(\n- \"TestSchema\", {\"properties\": {\"key\": {\"type\": \"string\"}}, \"type\": \"object\"}\n+ \"TestSchema\",\n+ {\"properties\": {\"key\": {\"type\": \"string\"}}, \"type\": \"object\"},\n)\n- spec = APISpec(\"Test API\", version=\"0.0.1\", openapi_version=\"2.0\", plugins=[TestPlugin()])\n- metadata = spec.to_dict()\n- assert metadata[\"definitions\"] == {\n- 'TestSchema': {'properties': {'key': {'type': 'string'}}, 'type': 'object'}\n+ spec = APISpec(\n+ \"Test API\", version=\"0.0.1\", openapi_version=\"2.0\", plugins=[TestPlugin()]\n+ )\n+ assert get_schemas(spec) == {\n+ \"TestSchema\": {\"properties\": {\"key\": {\"type\": \"string\"}}, \"type\": \"object\"}\n}\n" } ]
Python
MIT License
marshmallow-code/apispec
Apply flake8 and black formatting Use helper to retrieve schemas
394,028
17.03.2020 14:36:22
-7,200
4414d15320004498364136b72470b016eac4309d
Support schemas in callbacks Callback definitions are iterated and checked for schemas. This is implemented by running operation_helper on all events defined in a callback definition. These events may contain request and response definitions similar to regular operation definitions.
[ { "change_type": "MODIFY", "old_path": "AUTHORS.rst", "new_path": "AUTHORS.rst", "diff": "@@ -63,3 +63,4 @@ Contributors (chronological)\n- Ashutosh Chaudhary `@codeasashu <https://github.com/codeasashu>`_\n- Fedor Fominykh `@fedorfo <https://github.com/fedorfo>`_\n- Colin Bounouar `@Colin-b <https://github.com/Colin-b>`_\n+- Mikko Kortelainen `@kortsi <https://github.com/kortsi>\n" }, { "change_type": "MODIFY", "old_path": "src/apispec/ext/marshmallow/__init__.py", "new_path": "src/apispec/ext/marshmallow/__init__.py", "diff": "@@ -196,6 +196,9 @@ class MarshmallowPlugin(BasePlugin):\noperation[\"parameters\"]\n)\nif self.openapi_version.major >= 3:\n+ for callback in operation.get(\"callbacks\", {}).values():\n+ for event in callback.values():\n+ self.operation_helper(event)\nif \"requestBody\" in operation:\nself.resolver.resolve_schema(operation[\"requestBody\"])\nfor response in operation.get(\"responses\", {}).values():\n" }, { "change_type": "MODIFY", "old_path": "tests/test_ext_marshmallow.py", "new_path": "tests/test_ext_marshmallow.py", "diff": "@@ -418,6 +418,71 @@ class TestOperationHelper:\nassert resolved_schema == spec_fixture.openapi.schema2jsonschema(PetSchema)\nassert get[\"responses\"][\"200\"][\"description\"] == \"successful operation\"\n+ @pytest.mark.parametrize(\n+ \"pet_schema\",\n+ (PetSchema, PetSchema(), PetSchema(many=True), \"tests.schemas.PetSchema\"),\n+ )\n+ @pytest.mark.parametrize(\"spec_fixture\", (\"3.0.0\",), indirect=True)\n+ def test_callback_schema_v3(self, spec_fixture, pet_schema):\n+ spec_fixture.spec.path(\n+ path=\"/pet\",\n+ operations={\n+ \"post\": {\n+ \"callbacks\": {\n+ \"petEvent\": {\n+ \"petCallbackUrl\": {\n+ \"get\": {\n+ \"responses\": {\n+ \"200\": {\n+ \"content\": {\n+ \"application/json\": {\n+ \"schema\": pet_schema\n+ }\n+ },\n+ \"description\": \"successful operation\",\n+ \"headers\": {\n+ \"PetHeader\": {\"schema\": pet_schema}\n+ },\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\n+ },\n+ )\n+ p = get_paths(spec_fixture.spec)[\"/pet\"]\n+ c = p[\"post\"][\"callbacks\"][\"petEvent\"][\"petCallbackUrl\"]\n+ get = c[\"get\"]\n+ if isinstance(pet_schema, Schema) and pet_schema.many is True:\n+ assert (\n+ get[\"responses\"][\"200\"][\"content\"][\"application/json\"][\"schema\"][\"type\"]\n+ == \"array\"\n+ )\n+ schema_reference = get[\"responses\"][\"200\"][\"content\"][\"application/json\"][\n+ \"schema\"\n+ ][\"items\"]\n+ assert (\n+ get[\"responses\"][\"200\"][\"headers\"][\"PetHeader\"][\"schema\"][\"type\"]\n+ == \"array\"\n+ )\n+ header_reference = get[\"responses\"][\"200\"][\"headers\"][\"PetHeader\"][\n+ \"schema\"\n+ ][\"items\"]\n+ else:\n+ schema_reference = get[\"responses\"][\"200\"][\"content\"][\"application/json\"][\n+ \"schema\"\n+ ]\n+ header_reference = get[\"responses\"][\"200\"][\"headers\"][\"PetHeader\"][\"schema\"]\n+\n+ assert schema_reference == build_ref(spec_fixture.spec, \"schema\", \"Pet\")\n+ assert header_reference == build_ref(spec_fixture.spec, \"schema\", \"Pet\")\n+ assert len(spec_fixture.spec.components._schemas) == 1\n+ resolved_schema = spec_fixture.spec.components._schemas[\"Pet\"]\n+ assert resolved_schema == spec_fixture.openapi.schema2jsonschema(PetSchema)\n+ assert get[\"responses\"][\"200\"][\"description\"] == \"successful operation\"\n+\[email protected](\"spec_fixture\", (\"2.0\",), indirect=True)\ndef test_schema_expand_parameters_v2(self, spec_fixture):\nspec_fixture.spec.path(\n@@ -486,6 +551,54 @@ class TestOperationHelper:\nassert post[\"requestBody\"][\"description\"] == \"a pet schema\"\nassert post[\"requestBody\"][\"required\"]\n+ @pytest.mark.parametrize(\"spec_fixture\", (\"3.0.0\",), indirect=True)\n+ def test_callback_schema_expand_parameters_v3(self, spec_fixture):\n+ spec_fixture.spec.path(\n+ path=\"/pet\",\n+ operations={\n+ \"post\": {\n+ \"callbacks\": {\n+ \"petEvent\": {\n+ \"petCallbackUrl\": {\n+ \"get\": {\n+ \"parameters\": [{\"in\": \"query\", \"schema\": PetSchema}]\n+ },\n+ \"post\": {\n+ \"requestBody\": {\n+ \"description\": \"a pet schema\",\n+ \"required\": True,\n+ \"content\": {\n+ \"application/json\": {\"schema\": PetSchema}\n+ },\n+ }\n+ },\n+ }\n+ }\n+ }\n+ }\n+ },\n+ )\n+ p = get_paths(spec_fixture.spec)[\"/pet\"]\n+ c = p[\"post\"][\"callbacks\"][\"petEvent\"][\"petCallbackUrl\"]\n+ get = c[\"get\"]\n+ assert get[\"parameters\"] == spec_fixture.openapi.schema2parameters(\n+ PetSchema(), default_in=\"query\"\n+ )\n+ for parameter in get[\"parameters\"]:\n+ description = parameter.get(\"description\", False)\n+ assert description\n+ name = parameter[\"name\"]\n+ assert description == PetSchema.description[name]\n+ post = c[\"post\"]\n+ post_schema = spec_fixture.marshmallow_plugin.resolver.resolve_schema_dict(\n+ PetSchema\n+ )\n+ assert (\n+ post[\"requestBody\"][\"content\"][\"application/json\"][\"schema\"] == post_schema\n+ )\n+ assert post[\"requestBody\"][\"description\"] == \"a pet schema\"\n+ assert post[\"requestBody\"][\"required\"]\n+\[email protected](\"spec_fixture\", (\"2.0\",), indirect=True)\ndef test_schema_uses_ref_if_available_v2(self, spec_fixture):\nspec_fixture.spec.components.schema(\"Pet\", schema=PetSchema)\n@@ -515,6 +628,40 @@ class TestOperationHelper:\n\"schema\"\n] == build_ref(spec_fixture.spec, \"schema\", \"Pet\")\n+ @pytest.mark.parametrize(\"spec_fixture\", (\"3.0.0\",), indirect=True)\n+ def test_callback_schema_uses_ref_if_available_v3(self, spec_fixture):\n+ spec_fixture.spec.components.schema(\"Pet\", schema=PetSchema)\n+ spec_fixture.spec.path(\n+ path=\"/pet\",\n+ operations={\n+ \"post\": {\n+ \"callbacks\": {\n+ \"petEvent\": {\n+ \"petCallbackUrl\": {\n+ \"get\": {\n+ \"responses\": {\n+ \"200\": {\n+ \"content\": {\n+ \"application/json\": {\n+ \"schema\": PetSchema\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\n+ },\n+ )\n+ p = get_paths(spec_fixture.spec)[\"/pet\"]\n+ c = p[\"post\"][\"callbacks\"][\"petEvent\"][\"petCallbackUrl\"]\n+ get = c[\"get\"]\n+ assert get[\"responses\"][\"200\"][\"content\"][\"application/json\"][\n+ \"schema\"\n+ ] == build_ref(spec_fixture.spec, \"schema\", \"Pet\")\n+\ndef test_schema_uses_ref_if_available_name_resolver_returns_none_v2(self):\ndef resolver(schema):\nreturn None\n@@ -558,6 +705,48 @@ class TestOperationHelper:\n\"schema\"\n] == build_ref(spec, \"schema\", \"Pet\")\n+ def test_callback_schema_uses_ref_if_available_name_resolver_returns_none_v3(self):\n+ def resolver(schema):\n+ return None\n+\n+ spec = APISpec(\n+ title=\"Test auto-reference\",\n+ version=\"0.1\",\n+ openapi_version=\"3.0.0\",\n+ plugins=(MarshmallowPlugin(schema_name_resolver=resolver),),\n+ )\n+ spec.components.schema(\"Pet\", schema=PetSchema)\n+ spec.path(\n+ path=\"/pet\",\n+ operations={\n+ \"post\": {\n+ \"callbacks\": {\n+ \"petEvent\": {\n+ \"petCallbackUrl\": {\n+ \"get\": {\n+ \"responses\": {\n+ \"200\": {\n+ \"content\": {\n+ \"application/json\": {\n+ \"schema\": PetSchema\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\n+ },\n+ )\n+ p = get_paths(spec)[\"/pet\"]\n+ c = p[\"post\"][\"callbacks\"][\"petEvent\"][\"petCallbackUrl\"]\n+ get = c[\"get\"]\n+ assert get[\"responses\"][\"200\"][\"content\"][\"application/json\"][\n+ \"schema\"\n+ ] == build_ref(spec, \"schema\", \"Pet\")\n+\[email protected](\"spec_fixture\", (\"2.0\",), indirect=True)\ndef test_schema_uses_ref_in_parameters_and_request_body_if_available_v2(\nself, spec_fixture\n@@ -600,6 +789,41 @@ class TestOperationHelper:\nschema_ref = post[\"requestBody\"][\"content\"][\"application/json\"][\"schema\"]\nassert schema_ref == build_ref(spec_fixture.spec, \"schema\", \"Pet\")\n+ @pytest.mark.parametrize(\"spec_fixture\", (\"3.0.0\",), indirect=True)\n+ def test_callback_schema_uses_ref_in_parameters_and_request_body_if_available_v3(\n+ self, spec_fixture\n+ ):\n+ spec_fixture.spec.components.schema(\"Pet\", schema=PetSchema)\n+ spec_fixture.spec.path(\n+ path=\"/pet\",\n+ operations={\n+ \"post\": {\n+ \"callbacks\": {\n+ \"petEvent\": {\n+ \"petCallbackUrl\": {\n+ \"get\": {\n+ \"parameters\": [{\"in\": \"query\", \"schema\": PetSchema}]\n+ },\n+ \"post\": {\n+ \"requestBody\": {\n+ \"content\": {\n+ \"application/json\": {\"schema\": PetSchema}\n+ }\n+ }\n+ },\n+ }\n+ }\n+ }\n+ }\n+ },\n+ )\n+ p = get_paths(spec_fixture.spec)[\"/pet\"]\n+ c = p[\"post\"][\"callbacks\"][\"petEvent\"][\"petCallbackUrl\"]\n+ assert \"schema\" in c[\"get\"][\"parameters\"][0]\n+ post = c[\"post\"]\n+ schema_ref = post[\"requestBody\"][\"content\"][\"application/json\"][\"schema\"]\n+ assert schema_ref == build_ref(spec_fixture.spec, \"schema\", \"Pet\")\n+\[email protected](\"spec_fixture\", (\"2.0\",), indirect=True)\ndef test_schema_array_uses_ref_if_available_v2(self, spec_fixture):\nspec_fixture.spec.components.schema(\"Pet\", schema=PetSchema)\n@@ -672,6 +896,65 @@ class TestOperationHelper:\n]\nassert response_schema == resolved_schema\n+ @pytest.mark.parametrize(\"spec_fixture\", (\"3.0.0\",), indirect=True)\n+ def test_callback_schema_array_uses_ref_if_available_v3(self, spec_fixture):\n+ spec_fixture.spec.components.schema(\"Pet\", schema=PetSchema)\n+ spec_fixture.spec.path(\n+ path=\"/pet\",\n+ operations={\n+ \"post\": {\n+ \"callbacks\": {\n+ \"petEvent\": {\n+ \"petCallbackUrl\": {\n+ \"get\": {\n+ \"parameters\": [\n+ {\n+ \"name\": \"Pet\",\n+ \"in\": \"query\",\n+ \"content\": {\n+ \"application/json\": {\n+ \"schema\": {\n+ \"type\": \"array\",\n+ \"items\": PetSchema,\n+ }\n+ }\n+ },\n+ }\n+ ],\n+ \"responses\": {\n+ \"200\": {\n+ \"content\": {\n+ \"application/json\": {\n+ \"schema\": {\n+ \"type\": \"array\",\n+ \"items\": PetSchema,\n+ }\n+ }\n+ }\n+ }\n+ },\n+ }\n+ }\n+ }\n+ }\n+ }\n+ },\n+ )\n+ p = get_paths(spec_fixture.spec)[\"/pet\"]\n+ c = p[\"post\"][\"callbacks\"][\"petEvent\"][\"petCallbackUrl\"]\n+ get = c[\"get\"]\n+ assert len(get[\"parameters\"]) == 1\n+ resolved_schema = {\n+ \"type\": \"array\",\n+ \"items\": build_ref(spec_fixture.spec, \"schema\", \"Pet\"),\n+ }\n+ request_schema = get[\"parameters\"][0][\"content\"][\"application/json\"][\"schema\"]\n+ assert request_schema == resolved_schema\n+ response_schema = get[\"responses\"][\"200\"][\"content\"][\"application/json\"][\n+ \"schema\"\n+ ]\n+ assert response_schema == resolved_schema\n+\[email protected](\"spec_fixture\", (\"2.0\",), indirect=True)\ndef test_schema_partially_v2(self, spec_fixture):\nspec_fixture.spec.components.schema(\"Pet\", schema=PetSchema)\n@@ -736,6 +1019,50 @@ class TestOperationHelper:\n},\n}\n+ @pytest.mark.parametrize(\"spec_fixture\", (\"3.0.0\",), indirect=True)\n+ def test_callback_schema_partially_v3(self, spec_fixture):\n+ spec_fixture.spec.components.schema(\"Pet\", schema=PetSchema)\n+ spec_fixture.spec.path(\n+ path=\"/parents\",\n+ operations={\n+ \"post\": {\n+ \"callbacks\": {\n+ \"petEvent\": {\n+ \"petCallbackUrl\": {\n+ \"get\": {\n+ \"responses\": {\n+ \"200\": {\n+ \"content\": {\n+ \"application/json\": {\n+ \"schema\": {\n+ \"type\": \"object\",\n+ \"properties\": {\n+ \"mother\": PetSchema,\n+ \"father\": PetSchema,\n+ },\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\n+ },\n+ )\n+ p = get_paths(spec_fixture.spec)[\"/parents\"]\n+ c = p[\"post\"][\"callbacks\"][\"petEvent\"][\"petCallbackUrl\"]\n+ get = c[\"get\"]\n+ assert get[\"responses\"][\"200\"][\"content\"][\"application/json\"][\"schema\"] == {\n+ \"type\": \"object\",\n+ \"properties\": {\n+ \"mother\": build_ref(spec_fixture.spec, \"schema\", \"Pet\"),\n+ \"father\": build_ref(spec_fixture.spec, \"schema\", \"Pet\"),\n+ },\n+ }\n+\ndef test_parameter_reference(self, spec_fixture):\nif spec_fixture.spec.openapi_version.major < 3:\nparam = {\"schema\": PetSchema}\n" } ]
Python
MIT License
marshmallow-code/apispec
Support schemas in callbacks Callback definitions are iterated and checked for schemas. This is implemented by running operation_helper on all events defined in a callback definition. These events may contain request and response definitions similar to regular operation definitions.
394,000
22.05.2020 12:12:27
14,400
9df9b140db8d1af3779ca90759fe4205afbc8b70
Fix bug when resolver returns None and schema is a string Fixes
[ { "change_type": "MODIFY", "old_path": "src/apispec/ext/marshmallow/openapi.py", "new_path": "src/apispec/ext/marshmallow/openapi.py", "diff": "@@ -93,7 +93,7 @@ class OpenAPIConverter(FieldConverterMixin):\nname = self.schema_name_resolver(schema)\nif not name:\ntry:\n- json_schema = self.schema2jsonschema(schema)\n+ json_schema = self.schema2jsonschema(schema_instance)\nexcept RuntimeError:\nraise APISpecError(\n\"Name resolver returned None for schema {schema} which is \"\n" }, { "change_type": "MODIFY", "old_path": "tests/test_ext_marshmallow.py", "new_path": "tests/test_ext_marshmallow.py", "diff": "@@ -515,48 +515,54 @@ class TestOperationHelper:\n\"schema\"\n] == build_ref(spec_fixture.spec, \"schema\", \"Pet\")\n- def test_schema_uses_ref_if_available_name_resolver_returns_none_v2(self):\n+ @pytest.mark.parametrize(\n+ \"pet_schema\", (PetSchema, PetSchema(), \"tests.schemas.PetSchema\"),\n+ )\n+ def test_schema_name_resolver_returns_none_v2(self, pet_schema):\ndef resolver(schema):\nreturn None\nspec = APISpec(\n- title=\"Test auto-reference\",\n+ title=\"Test resolver returns None\",\nversion=\"0.1\",\nopenapi_version=\"2.0\",\nplugins=(MarshmallowPlugin(schema_name_resolver=resolver),),\n)\n- spec.components.schema(\"Pet\", schema=PetSchema)\nspec.path(\n- path=\"/pet\", operations={\"get\": {\"responses\": {200: {\"schema\": PetSchema}}}}\n+ path=\"/pet\",\n+ operations={\"get\": {\"responses\": {200: {\"schema\": pet_schema}}}},\n)\nget = get_paths(spec)[\"/pet\"][\"get\"]\n- assert get[\"responses\"][\"200\"][\"schema\"] == build_ref(spec, \"schema\", \"Pet\")\n+ assert \"properties\" in get[\"responses\"][\"200\"][\"schema\"]\n- def test_schema_uses_ref_if_available_name_resolver_returns_none_v3(self):\n+ @pytest.mark.parametrize(\n+ \"pet_schema\", (PetSchema, PetSchema(), \"tests.schemas.PetSchema\"),\n+ )\n+ def test_schema_name_resolver_returns_none_v3(self, pet_schema):\ndef resolver(schema):\nreturn None\nspec = APISpec(\n- title=\"Test auto-reference\",\n+ title=\"Test resolver returns None\",\nversion=\"0.1\",\nopenapi_version=\"3.0.0\",\nplugins=(MarshmallowPlugin(schema_name_resolver=resolver),),\n)\n- spec.components.schema(\"Pet\", schema=PetSchema)\nspec.path(\npath=\"/pet\",\noperations={\n\"get\": {\n\"responses\": {\n- 200: {\"content\": {\"application/json\": {\"schema\": PetSchema}}}\n+ 200: {\"content\": {\"application/json\": {\"schema\": pet_schema}}}\n}\n}\n},\n)\nget = get_paths(spec)[\"/pet\"][\"get\"]\n- assert get[\"responses\"][\"200\"][\"content\"][\"application/json\"][\n- \"schema\"\n- ] == build_ref(spec, \"schema\", \"Pet\")\n+ assert (\n+ \"properties\"\n+ in get[\"responses\"][\"200\"][\"content\"][\"application/json\"][\"schema\"]\n+ )\[email protected](\"spec_fixture\", (\"2.0\",), indirect=True)\ndef test_schema_uses_ref_in_parameters_and_request_body_if_available_v2(\n" } ]
Python
MIT License
marshmallow-code/apispec
Fix bug when resolver returns None and schema is a string Fixes #566
393,995
13.07.2020 19:17:51
-7,200
e4704b8dfdd489ca7f6e18709e2d4418d0961951
Ignore field metadata with non-string keys
[ { "change_type": "MODIFY", "old_path": "AUTHORS.rst", "new_path": "AUTHORS.rst", "diff": "@@ -64,3 +64,4 @@ Contributors (chronological)\n- Fedor Fominykh `@fedorfo <https://github.com/fedorfo>`_\n- Colin Bounouar `@Colin-b <https://github.com/Colin-b>`_\n- David Bishop `@teancom <https://github.com/teancom>`_\n+- Andrea Ghensi `@sanzoghenzo <https://github.com/sanzoghenzo>`_\n" }, { "change_type": "MODIFY", "old_path": "src/apispec/ext/marshmallow/field_converter.py", "new_path": "src/apispec/ext/marshmallow/field_converter.py", "diff": "@@ -397,6 +397,7 @@ class FieldConverterMixin:\nmetadata = {\nkey.replace(\"_\", \"-\") if key.startswith(\"x_\") else key: value\nfor key, value in field.metadata.items()\n+ if isinstance(key, str)\n}\n# Avoid validation error with \"Additional properties not allowed\"\n" }, { "change_type": "MODIFY", "old_path": "tests/test_ext_marshmallow_field.py", "new_path": "tests/test_ext_marshmallow_field.py", "diff": "@@ -293,3 +293,13 @@ def test_custom_properties_for_custom_fields(spec_fixture):\nassert properties[\"x-customString\"] == (\nspec_fixture.openapi.openapi_version == \"2.0\"\n)\n+\n+\n+def test_field2property_with_non_string_metadata_keys(spec_fixture):\n+ class _DesertSentinel:\n+ pass\n+\n+ field = fields.Boolean(description=\"A description\")\n+ field.metadata[_DesertSentinel()] = \"to be ignored\"\n+ result = spec_fixture.openapi.field2property(field)\n+ assert result == {\"description\": \"A description\", \"type\": \"boolean\"}\n" } ]
Python
MIT License
marshmallow-code/apispec
Ignore field metadata with non-string keys
394,028
07.12.2020 10:15:48
-7,200
e926c19a34581eddea673546c82afa1b1ca7c66a
Implement resolve_callback
[ { "change_type": "MODIFY", "old_path": "src/apispec/ext/marshmallow/__init__.py", "new_path": "src/apispec/ext/marshmallow/__init__.py", "diff": "@@ -187,6 +187,57 @@ class MarshmallowPlugin(BasePlugin):\nself.resolver.resolve_response(response)\nreturn response\n+ def resolve_callback(self, callbacks):\n+ \"\"\"Resolve marshmallow Schemas in a dict mapping callback name to OpenApi `Callback Object\n+ https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#callbackObject`_.\n+\n+ This is done recursively, so it it is possible to define callbacks in your callbacks.\n+\n+ Example: ::\n+\n+ #Input\n+ {\n+ \"userEvent\": {\n+ \"https://my.example/user-callback\": {\n+ \"post\": {\n+ \"requestBody\": {\n+ \"content\": {\n+ \"application/json\": {\n+ \"schema\": UserSchema\n+ }\n+ }\n+ }\n+ },\n+ }\n+ }\n+ }\n+\n+ #Output\n+ {\n+ \"userEvent\": {\n+ \"https://my.example/user-callback\": {\n+ \"post\": {\n+ \"requestBody\": {\n+ \"content\": {\n+ \"application/json\": {\n+ \"schema\": {\n+ \"$ref\": \"#/components/schemas/User\"\n+ }\n+ }\n+ }\n+ }\n+ },\n+ }\n+ }\n+ }\n+\n+\n+ \"\"\"\n+ for callback in callbacks.values():\n+ if isinstance(callback, dict):\n+ for path in callback.values():\n+ self.operation_helper(path)\n+\ndef operation_helper(self, operations, **kwargs):\nfor operation in operations.values():\nif not isinstance(operation, dict):\n@@ -196,9 +247,7 @@ class MarshmallowPlugin(BasePlugin):\noperation[\"parameters\"]\n)\nif self.openapi_version.major >= 3:\n- for callback in operation.get(\"callbacks\", {}).values():\n- for event in callback.values():\n- self.operation_helper(event)\n+ self.resolve_callback(operation.get(\"callbacks\", {}))\nif \"requestBody\" in operation:\nself.resolver.resolve_schema(operation[\"requestBody\"])\nfor response in operation.get(\"responses\", {}).values():\n" } ]
Python
MIT License
marshmallow-code/apispec
Implement resolve_callback
394,028
07.12.2020 11:58:47
-7,200
ffe359e7c0b73248ddb9e47d6074fae4394bd5b4
Refactor callback tests
[ { "change_type": "MODIFY", "old_path": "tests/test_ext_marshmallow.py", "new_path": "tests/test_ext_marshmallow.py", "diff": "@@ -328,6 +328,19 @@ def get_nested_schema(schema, field_name):\nclass TestOperationHelper:\n+ @pytest.fixture\n+ def make_pet_callback_spec(self, spec_fixture):\n+ def _make_pet_spec(operations):\n+ spec_fixture.spec.path(\n+ path=\"/pet\",\n+ operations={\n+ \"post\": {\"callbacks\": {\"petEvent\": {\"petCallbackUrl\": operations}}}\n+ },\n+ )\n+ return spec_fixture\n+\n+ return _make_pet_spec\n+\[email protected](\n\"pet_schema\",\n(PetSchema, PetSchema(), PetSchema(many=True), \"tests.schemas.PetSchema\"),\n@@ -423,34 +436,19 @@ class TestOperationHelper:\n(PetSchema, PetSchema(), PetSchema(many=True), \"tests.schemas.PetSchema\"),\n)\[email protected](\"spec_fixture\", (\"3.0.0\",), indirect=True)\n- def test_callback_schema_v3(self, spec_fixture, pet_schema):\n- spec_fixture.spec.path(\n- path=\"/pet\",\n- operations={\n- \"post\": {\n- \"callbacks\": {\n- \"petEvent\": {\n- \"petCallbackUrl\": {\n+ def test_callback_schema_v3(self, make_pet_callback_spec, pet_schema):\n+ spec_fixture = make_pet_callback_spec(\n+ {\n\"get\": {\n\"responses\": {\n\"200\": {\n- \"content\": {\n- \"application/json\": {\n- \"schema\": pet_schema\n- }\n- },\n+ \"content\": {\"application/json\": {\"schema\": pet_schema}},\n\"description\": \"successful operation\",\n- \"headers\": {\n- \"PetHeader\": {\"schema\": pet_schema}\n- },\n- }\n- }\n- }\n+ \"headers\": {\"PetHeader\": {\"schema\": pet_schema}},\n}\n}\n}\n}\n- },\n)\np = get_paths(spec_fixture.spec)[\"/pet\"]\nc = p[\"post\"][\"callbacks\"][\"petEvent\"][\"petCallbackUrl\"]\n@@ -552,31 +550,18 @@ class TestOperationHelper:\nassert post[\"requestBody\"][\"required\"]\[email protected](\"spec_fixture\", (\"3.0.0\",), indirect=True)\n- def test_callback_schema_expand_parameters_v3(self, spec_fixture):\n- spec_fixture.spec.path(\n- path=\"/pet\",\n- operations={\n- \"post\": {\n- \"callbacks\": {\n- \"petEvent\": {\n- \"petCallbackUrl\": {\n- \"get\": {\n- \"parameters\": [{\"in\": \"query\", \"schema\": PetSchema}]\n- },\n+ def test_callback_schema_expand_parameters_v3(self, make_pet_callback_spec):\n+ spec_fixture = make_pet_callback_spec(\n+ {\n+ \"get\": {\"parameters\": [{\"in\": \"query\", \"schema\": PetSchema}]},\n\"post\": {\n\"requestBody\": {\n\"description\": \"a pet schema\",\n\"required\": True,\n- \"content\": {\n- \"application/json\": {\"schema\": PetSchema}\n- },\n+ \"content\": {\"application/json\": {\"schema\": PetSchema}},\n}\n},\n}\n- }\n- }\n- }\n- },\n)\np = get_paths(spec_fixture.spec)[\"/pet\"]\nc = p[\"post\"][\"callbacks\"][\"petEvent\"][\"petCallbackUrl\"]\n@@ -629,31 +614,15 @@ class TestOperationHelper:\n] == build_ref(spec_fixture.spec, \"schema\", \"Pet\")\[email protected](\"spec_fixture\", (\"3.0.0\",), indirect=True)\n- def test_callback_schema_uses_ref_if_available_v3(self, spec_fixture):\n- spec_fixture.spec.components.schema(\"Pet\", schema=PetSchema)\n- spec_fixture.spec.path(\n- path=\"/pet\",\n- operations={\n- \"post\": {\n- \"callbacks\": {\n- \"petEvent\": {\n- \"petCallbackUrl\": {\n+ def test_callback_schema_uses_ref_if_available_v3(self, make_pet_callback_spec):\n+ spec_fixture = make_pet_callback_spec(\n+ {\n\"get\": {\n\"responses\": {\n- \"200\": {\n- \"content\": {\n- \"application/json\": {\n- \"schema\": PetSchema\n- }\n- }\n- }\n+ \"200\": {\"content\": {\"application/json\": {\"schema\": PetSchema}}}\n}\n}\n}\n- }\n- }\n- }\n- },\n)\np = get_paths(spec_fixture.spec)[\"/pet\"]\nc = p[\"post\"][\"callbacks\"][\"petEvent\"][\"petCallbackUrl\"]\n@@ -791,31 +760,17 @@ class TestOperationHelper:\[email protected](\"spec_fixture\", (\"3.0.0\",), indirect=True)\ndef test_callback_schema_uses_ref_in_parameters_and_request_body_if_available_v3(\n- self, spec_fixture\n+ self, make_pet_callback_spec\n):\n- spec_fixture.spec.components.schema(\"Pet\", schema=PetSchema)\n- spec_fixture.spec.path(\n- path=\"/pet\",\n- operations={\n- \"post\": {\n- \"callbacks\": {\n- \"petEvent\": {\n- \"petCallbackUrl\": {\n- \"get\": {\n- \"parameters\": [{\"in\": \"query\", \"schema\": PetSchema}]\n- },\n+ spec_fixture = make_pet_callback_spec(\n+ {\n+ \"get\": {\"parameters\": [{\"in\": \"query\", \"schema\": PetSchema}]},\n\"post\": {\n\"requestBody\": {\n- \"content\": {\n- \"application/json\": {\"schema\": PetSchema}\n- }\n+ \"content\": {\"application/json\": {\"schema\": PetSchema}}\n}\n},\n}\n- }\n- }\n- }\n- },\n)\np = get_paths(spec_fixture.spec)[\"/pet\"]\nc = p[\"post\"][\"callbacks\"][\"petEvent\"][\"petCallbackUrl\"]\n@@ -897,15 +852,11 @@ class TestOperationHelper:\nassert response_schema == resolved_schema\[email protected](\"spec_fixture\", (\"3.0.0\",), indirect=True)\n- def test_callback_schema_array_uses_ref_if_available_v3(self, spec_fixture):\n- spec_fixture.spec.components.schema(\"Pet\", schema=PetSchema)\n- spec_fixture.spec.path(\n- path=\"/pet\",\n- operations={\n- \"post\": {\n- \"callbacks\": {\n- \"petEvent\": {\n- \"petCallbackUrl\": {\n+ def test_callback_schema_array_uses_ref_if_available_v3(\n+ self, make_pet_callback_spec\n+ ):\n+ spec_fixture = make_pet_callback_spec(\n+ {\n\"get\": {\n\"parameters\": [\n{\n@@ -913,10 +864,7 @@ class TestOperationHelper:\n\"in\": \"query\",\n\"content\": {\n\"application/json\": {\n- \"schema\": {\n- \"type\": \"array\",\n- \"items\": PetSchema,\n- }\n+ \"schema\": {\"type\": \"array\", \"items\": PetSchema}\n}\n},\n}\n@@ -925,20 +873,13 @@ class TestOperationHelper:\n\"200\": {\n\"content\": {\n\"application/json\": {\n- \"schema\": {\n- \"type\": \"array\",\n- \"items\": PetSchema,\n- }\n+ \"schema\": {\"type\": \"array\", \"items\": PetSchema}\n}\n}\n}\n},\n}\n}\n- }\n- }\n- }\n- },\n)\np = get_paths(spec_fixture.spec)[\"/pet\"]\nc = p[\"post\"][\"callbacks\"][\"petEvent\"][\"petCallbackUrl\"]\n@@ -1020,15 +961,9 @@ class TestOperationHelper:\n}\[email protected](\"spec_fixture\", (\"3.0.0\",), indirect=True)\n- def test_callback_schema_partially_v3(self, spec_fixture):\n- spec_fixture.spec.components.schema(\"Pet\", schema=PetSchema)\n- spec_fixture.spec.path(\n- path=\"/parents\",\n- operations={\n- \"post\": {\n- \"callbacks\": {\n- \"petEvent\": {\n- \"petCallbackUrl\": {\n+ def test_callback_schema_partially_v3(self, make_pet_callback_spec):\n+ spec_fixture = make_pet_callback_spec(\n+ {\n\"get\": {\n\"responses\": {\n\"200\": {\n@@ -1047,12 +982,8 @@ class TestOperationHelper:\n}\n}\n}\n- }\n- }\n- }\n- },\n)\n- p = get_paths(spec_fixture.spec)[\"/parents\"]\n+ p = get_paths(spec_fixture.spec)[\"/pet\"]\nc = p[\"post\"][\"callbacks\"][\"petEvent\"][\"petCallbackUrl\"]\nget = c[\"get\"]\nassert get[\"responses\"][\"200\"][\"content\"][\"application/json\"][\"schema\"] == {\n" } ]
Python
MIT License
marshmallow-code/apispec
Refactor callback tests
394,028
07.12.2020 12:26:06
-7,200
3810c23552eb77da04a49e68fb83b1bf5074787a
Add back accidentally removed callback test
[ { "change_type": "MODIFY", "old_path": "tests/test_ext_marshmallow.py", "new_path": "tests/test_ext_marshmallow.py", "diff": "@@ -722,6 +722,48 @@ class TestOperationHelper:\nin get[\"responses\"][\"200\"][\"content\"][\"application/json\"][\"schema\"]\n)\n+ def test_callback_schema_uses_ref_if_available_name_resolver_returns_none_v3(self):\n+ def resolver(schema):\n+ return None\n+\n+ spec = APISpec(\n+ title=\"Test auto-reference\",\n+ version=\"0.1\",\n+ openapi_version=\"3.0.0\",\n+ plugins=(MarshmallowPlugin(schema_name_resolver=resolver),),\n+ )\n+ spec.components.schema(\"Pet\", schema=PetSchema)\n+ spec.path(\n+ path=\"/pet\",\n+ operations={\n+ \"post\": {\n+ \"callbacks\": {\n+ \"petEvent\": {\n+ \"petCallbackUrl\": {\n+ \"get\": {\n+ \"responses\": {\n+ \"200\": {\n+ \"content\": {\n+ \"application/json\": {\n+ \"schema\": PetSchema\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\n+ },\n+ )\n+ p = get_paths(spec)[\"/pet\"]\n+ c = p[\"post\"][\"callbacks\"][\"petEvent\"][\"petCallbackUrl\"]\n+ get = c[\"get\"]\n+ assert get[\"responses\"][\"200\"][\"content\"][\"application/json\"][\n+ \"schema\"\n+ ] == build_ref(spec, \"schema\", \"Pet\")\n+\[email protected](\"spec_fixture\", (\"2.0\",), indirect=True)\ndef test_schema_uses_ref_in_parameters_and_request_body_if_available_v2(\nself, spec_fixture\n" } ]
Python
MIT License
marshmallow-code/apispec
Add back accidentally removed callback test
394,028
09.12.2020 07:28:48
-7,200
f3713eb2598b70f979a1b202af5668ca596d0980
Move resolve_callback to SchemaResolver
[ { "change_type": "MODIFY", "old_path": "src/apispec/ext/marshmallow/__init__.py", "new_path": "src/apispec/ext/marshmallow/__init__.py", "diff": "@@ -186,71 +186,8 @@ class MarshmallowPlugin(BasePlugin):\nself.resolver.resolve_response(response)\nreturn response\n- def resolve_callback(self, callbacks):\n- \"\"\"Resolve marshmallow Schemas in a dict mapping callback name to OpenApi `Callback Object\n- https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#callbackObject`_.\n-\n- This is done recursively, so it it is possible to define callbacks in your callbacks.\n-\n- Example: ::\n-\n- #Input\n- {\n- \"userEvent\": {\n- \"https://my.example/user-callback\": {\n- \"post\": {\n- \"requestBody\": {\n- \"content\": {\n- \"application/json\": {\n- \"schema\": UserSchema\n- }\n- }\n- }\n- },\n- }\n- }\n- }\n-\n- #Output\n- {\n- \"userEvent\": {\n- \"https://my.example/user-callback\": {\n- \"post\": {\n- \"requestBody\": {\n- \"content\": {\n- \"application/json\": {\n- \"schema\": {\n- \"$ref\": \"#/components/schemas/User\"\n- }\n- }\n- }\n- }\n- },\n- }\n- }\n- }\n-\n-\n- \"\"\"\n- for callback in callbacks.values():\n- if isinstance(callback, dict):\n- for path in callback.values():\n- self.operation_helper(path)\n-\ndef operation_helper(self, operations, **kwargs):\n- for operation in operations.values():\n- if not isinstance(operation, dict):\n- continue\n- if \"parameters\" in operation:\n- operation[\"parameters\"] = self.resolver.resolve_parameters(\n- operation[\"parameters\"]\n- )\n- if self.openapi_version.major >= 3:\n- self.resolve_callback(operation.get(\"callbacks\", {}))\n- if \"requestBody\" in operation:\n- self.resolver.resolve_schema(operation[\"requestBody\"])\n- for response in operation.get(\"responses\", {}).values():\n- self.resolver.resolve_response(response)\n+ self.resolver.resolve_operations(operations)\ndef warn_if_schema_already_in_spec(self, schema_key):\n\"\"\"Method to warn the user if the schema has already been added to the\n" }, { "change_type": "MODIFY", "old_path": "src/apispec/ext/marshmallow/schema_resolver.py", "new_path": "src/apispec/ext/marshmallow/schema_resolver.py", "diff": "@@ -15,6 +15,75 @@ class SchemaResolver:\nself.openapi_version = openapi_version\nself.converter = converter\n+ def resolve_operations(self, operations, **kwargs):\n+ \"\"\"Resolve marshmallow Schemas in a dict mapping operation to OpenApi `Operation Object\n+ https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#operationObject`_\"\"\"\n+\n+ for operation in operations.values():\n+ if not isinstance(operation, dict):\n+ continue\n+ if \"parameters\" in operation:\n+ operation[\"parameters\"] = self.resolve_parameters(\n+ operation[\"parameters\"]\n+ )\n+ if self.openapi_version.major >= 3:\n+ self.resolve_callback(operation.get(\"callbacks\", {}))\n+ if \"requestBody\" in operation:\n+ self.resolve_schema(operation[\"requestBody\"])\n+ for response in operation.get(\"responses\", {}).values():\n+ self.resolve_response(response)\n+\n+ def resolve_callback(self, callbacks):\n+ \"\"\"Resolve marshmallow Schemas in a dict mapping callback name to OpenApi `Callback Object\n+ https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#callbackObject`_.\n+\n+ This is done recursively, so it it is possible to define callbacks in your callbacks.\n+\n+ Example: ::\n+\n+ #Input\n+ {\n+ \"userEvent\": {\n+ \"https://my.example/user-callback\": {\n+ \"post\": {\n+ \"requestBody\": {\n+ \"content\": {\n+ \"application/json\": {\n+ \"schema\": UserSchema\n+ }\n+ }\n+ }\n+ },\n+ }\n+ }\n+ }\n+\n+ #Output\n+ {\n+ \"userEvent\": {\n+ \"https://my.example/user-callback\": {\n+ \"post\": {\n+ \"requestBody\": {\n+ \"content\": {\n+ \"application/json\": {\n+ \"schema\": {\n+ \"$ref\": \"#/components/schemas/User\"\n+ }\n+ }\n+ }\n+ }\n+ },\n+ }\n+ }\n+ }\n+\n+\n+ \"\"\"\n+ for callback in callbacks.values():\n+ if isinstance(callback, dict):\n+ for path in callback.values():\n+ self.resolve_operations(path)\n+\ndef resolve_parameters(self, parameters):\n\"\"\"Resolve marshmallow Schemas in a list of OpenAPI `Parameter Objects\n<https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#parameter-object>`_.\n" } ]
Python
MIT License
marshmallow-code/apispec
Move resolve_callback to SchemaResolver
394,000
09.12.2020 16:38:44
18,000
954bbbc0db2728c7a02d2873e79c04062a37c05c
Change implementation for finding min and max values Fixes an issue with the ordering of multiple range and length validators. Previously only the last value for min and max would be used because hasattr of a dict returns False.
[ { "change_type": "MODIFY", "old_path": "src/apispec/ext/marshmallow/field_converter.py", "new_path": "src/apispec/ext/marshmallow/field_converter.py", "diff": "@@ -290,17 +290,16 @@ class FieldConverterMixin:\n]\nattributes = {}\n- for validator in validators:\n- if validator.min is not None:\n- if hasattr(attributes, \"minimum\"):\n- attributes[\"minimum\"] = max(attributes[\"minimum\"], validator.min)\n- else:\n- attributes[\"minimum\"] = validator.min\n- if validator.max is not None:\n- if hasattr(attributes, \"maximum\"):\n- attributes[\"maximum\"] = min(attributes[\"maximum\"], validator.max)\n- else:\n- attributes[\"maximum\"] = validator.max\n+ min_list = [\n+ validator.min for validator in validators if validator.min is not None\n+ ]\n+ max_list = [\n+ validator.max for validator in validators if validator.max is not None\n+ ]\n+ if min_list:\n+ attributes[\"minimum\"] = max(min_list)\n+ if max_list:\n+ attributes[\"maximum\"] = min(max_list)\nreturn attributes\ndef field2length(self, field, **kwargs):\n@@ -328,22 +327,22 @@ class FieldConverterMixin:\nmin_attr = \"minItems\" if is_array else \"minLength\"\nmax_attr = \"maxItems\" if is_array else \"maxLength\"\n- for validator in validators:\n- if validator.min is not None:\n- if hasattr(attributes, min_attr):\n- attributes[min_attr] = max(attributes[min_attr], validator.min)\n- else:\n- attributes[min_attr] = validator.min\n- if validator.max is not None:\n- if hasattr(attributes, max_attr):\n- attributes[max_attr] = min(attributes[max_attr], validator.max)\n- else:\n- attributes[max_attr] = validator.max\n+ equal_list = [\n+ validator.equal for validator in validators if validator.equal is not None\n+ ]\n+ if equal_list:\n+ return {min_attr: equal_list[0], max_attr: equal_list[0]}\n- for validator in validators:\n- if validator.equal is not None:\n- attributes[min_attr] = validator.equal\n- attributes[max_attr] = validator.equal\n+ min_list = [\n+ validator.min for validator in validators if validator.min is not None\n+ ]\n+ max_list = [\n+ validator.max for validator in validators if validator.max is not None\n+ ]\n+ if min_list:\n+ attributes[min_attr] = max(min_list)\n+ if max_list:\n+ attributes[max_attr] = min(max_list)\nreturn attributes\ndef field2pattern(self, field, **kwargs):\n" }, { "change_type": "MODIFY", "old_path": "tests/test_ext_marshmallow_openapi.py", "new_path": "tests/test_ext_marshmallow_openapi.py", "diff": "@@ -498,6 +498,7 @@ class TestFieldValidation:\nclass ValidationSchema(Schema):\nid = fields.Int(dump_only=True)\nrange = fields.Int(validate=validate.Range(min=1, max=10))\n+ range_no_upper = fields.Int(validate=validate.Range(min=1))\nmultiple_ranges = fields.Int(\nvalidate=[\nvalidate.Range(min=1),\n@@ -528,6 +529,7 @@ class TestFieldValidation:\n(\"field\", \"properties\"),\n[\n(\"range\", {\"minimum\": 1, \"maximum\": 10}),\n+ (\"range_no_upper\", {\"minimum\": 1}),\n(\"multiple_ranges\", {\"minimum\": 3, \"maximum\": 7}),\n(\"list_length\", {\"minItems\": 1, \"maxItems\": 10}),\n(\"custom_list_length\", {\"minItems\": 1, \"maxItems\": 10}),\n" } ]
Python
MIT License
marshmallow-code/apispec
Change implementation for finding min and max values Fixes an issue with the ordering of multiple range and length validators. Previously only the last value for min and max would be used because hasattr of a dict returns False.
394,000
09.12.2020 18:58:37
18,000
6dd423ada87b8e279e5b06c889b4640a0dc9c1ed
Use x- extensions for when the field is not a number Closes
[ { "change_type": "MODIFY", "old_path": "src/apispec/ext/marshmallow/field_converter.py", "new_path": "src/apispec/ext/marshmallow/field_converter.py", "diff": "@@ -290,6 +290,11 @@ class FieldConverterMixin:\n]\nattributes = {}\n+ min_attr, max_attr = (\n+ (\"minimum\", \"maximum\")\n+ if marshmallow.fields.Number in type(field).mro()\n+ else (\"x-minimum\", \"x-maximum\")\n+ )\nmin_list = [\nvalidator.min for validator in validators if validator.min is not None\n]\n@@ -297,9 +302,9 @@ class FieldConverterMixin:\nvalidator.max for validator in validators if validator.max is not None\n]\nif min_list:\n- attributes[\"minimum\"] = max(min_list)\n+ attributes[min_attr] = max(min_list)\nif max_list:\n- attributes[\"maximum\"] = min(max_list)\n+ attributes[max_attr] = min(max_list)\nreturn attributes\ndef field2length(self, field, **kwargs):\n" }, { "change_type": "MODIFY", "old_path": "tests/test_ext_marshmallow_openapi.py", "new_path": "tests/test_ext_marshmallow_openapi.py", "diff": "import pytest\n+from datetime import datetime\nfrom marshmallow import fields, Schema, validate\n@@ -524,6 +525,7 @@ class TestFieldValidation:\nequal_length = fields.Str(\nvalidate=[validate.Length(equal=5), validate.Length(min=1, max=10)]\n)\n+ date_range = fields.DateTime(validate=validate.Range(min=datetime(1900, 1, 1),))\[email protected](\n(\"field\", \"properties\"),\n@@ -537,6 +539,7 @@ class TestFieldValidation:\n(\"custom_field_length\", {\"minLength\": 1, \"maxLength\": 10}),\n(\"multiple_lengths\", {\"minLength\": 3, \"maxLength\": 7}),\n(\"equal_length\", {\"minLength\": 5, \"maxLength\": 5}),\n+ (\"date_range\", {\"x-minimum\": datetime(1900, 1, 1)}),\n],\n)\ndef test_properties(self, field, properties, spec):\n" } ]
Python
MIT License
marshmallow-code/apispec
Use x- extensions for when the field is not a number Closes #614
394,000
09.12.2020 19:16:17
18,000
8629210707c086a87d1bde73e6d7a0f848aef5f9
Extract logic for creating minimum and maximum attributes
[ { "change_type": "MODIFY", "old_path": "src/apispec/ext/marshmallow/field_converter.py", "new_path": "src/apispec/ext/marshmallow/field_converter.py", "diff": "@@ -289,23 +289,12 @@ class FieldConverterMixin:\n)\n]\n- attributes = {}\nmin_attr, max_attr = (\n(\"minimum\", \"maximum\")\nif marshmallow.fields.Number in type(field).mro()\nelse (\"x-minimum\", \"x-maximum\")\n)\n- min_list = [\n- validator.min for validator in validators if validator.min is not None\n- ]\n- max_list = [\n- validator.max for validator in validators if validator.max is not None\n- ]\n- if min_list:\n- attributes[min_attr] = max(min_list)\n- if max_list:\n- attributes[max_attr] = min(max_list)\n- return attributes\n+ return make_min_max_attributes(validators, min_attr, max_attr)\ndef field2length(self, field, **kwargs):\n\"\"\"Return the dictionary of OpenAPI field attributes for a set of\n@@ -314,8 +303,6 @@ class FieldConverterMixin:\n:param Field field: A marshmallow field.\n:rtype: dict\n\"\"\"\n- attributes = {}\n-\nvalidators = [\nvalidator\nfor validator in field.validators\n@@ -338,17 +325,7 @@ class FieldConverterMixin:\nif equal_list:\nreturn {min_attr: equal_list[0], max_attr: equal_list[0]}\n- min_list = [\n- validator.min for validator in validators if validator.min is not None\n- ]\n- max_list = [\n- validator.max for validator in validators if validator.max is not None\n- ]\n- if min_list:\n- attributes[min_attr] = max(min_list)\n- if max_list:\n- attributes[max_attr] = min(max_list)\n- return attributes\n+ return make_min_max_attributes(validators, min_attr, max_attr)\ndef field2pattern(self, field, **kwargs):\n\"\"\"Return the dictionary of OpenAPI field attributes for a set of\n@@ -453,3 +430,23 @@ class FieldConverterMixin:\nif value_field:\nret[\"additionalProperties\"] = self.field2property(value_field)\nreturn ret\n+\n+\n+def make_min_max_attributes(validators, min_attr, max_attr):\n+ \"\"\"Return a dictionary of minimum and maximum attributes based on a list\n+ of validators. If either minimum or maximum values are not present in any\n+ of the validator objects that attribute will be omitted.\n+\n+ :param validators list: A list of `Marshmallow` validator objects. Each\n+ objct is inspected for a minimum and maximum values\n+ :param min_attr string: The OpenAPI attribute for the minimum value\n+ :param max_attr string: The OpenAPI attribute for the maximum value\n+ \"\"\"\n+ attributes = {}\n+ min_list = [validator.min for validator in validators if validator.min is not None]\n+ max_list = [validator.max for validator in validators if validator.max is not None]\n+ if min_list:\n+ attributes[min_attr] = max(min_list)\n+ if max_list:\n+ attributes[max_attr] = min(max_list)\n+ return attributes\n" } ]
Python
MIT License
marshmallow-code/apispec
Extract logic for creating minimum and maximum attributes
393,998
11.03.2021 03:02:17
0
5b07c46869f60a6a8faa54d09ef397c7e52e9390
Populate additionalProperties from Meta.unknown Derive the value of additionalProperties from Meta.unknown, if defined. additionalProperties will be true only if Meta.unknown == INCLUDE
[ { "change_type": "MODIFY", "old_path": "src/apispec/ext/marshmallow/openapi.py", "new_path": "src/apispec/ext/marshmallow/openapi.py", "diff": "@@ -178,6 +178,8 @@ class OpenAPIConverter(FieldConverterMixin):\njsonschema[\"title\"] = Meta.title\nif hasattr(Meta, \"description\"):\njsonschema[\"description\"] = Meta.description\n+ if hasattr(Meta, \"unknown\"):\n+ jsonschema[\"additionalProperties\"] = Meta.unknown == marshmallow.INCLUDE\nreturn jsonschema\n" }, { "change_type": "MODIFY", "old_path": "tests/test_ext_marshmallow_openapi.py", "new_path": "tests/test_ext_marshmallow_openapi.py", "diff": "import pytest\nfrom datetime import datetime\n-from marshmallow import fields, Schema, validate\n+from marshmallow import fields, INCLUDE, RAISE, Schema, validate\nfrom apispec.ext.marshmallow import MarshmallowPlugin\nfrom apispec import exceptions, utils, APISpec\n@@ -132,6 +132,26 @@ class TestMarshmallowSchemaToModelDefinition:\nres = openapi.schema2jsonschema(WhiteStripesSchema)\nassert set(res[\"properties\"].keys()) == {\"guitarist\", \"drummer\"}\n+ def test_unknown_values_disallow(self, openapi):\n+ class UnknownRaiseSchema(Schema):\n+ class Meta:\n+ unknown = RAISE\n+\n+ first = fields.Str()\n+\n+ res = openapi.schema2jsonschema(UnknownRaiseSchema)\n+ assert res[\"additionalProperties\"] is False\n+\n+ def test_unknown_values_allow(self, openapi):\n+ class UnknownIncludeSchema(Schema):\n+ class Meta:\n+ unknown = INCLUDE\n+\n+ first = fields.Str()\n+\n+ res = openapi.schema2jsonschema(UnknownIncludeSchema)\n+ assert res[\"additionalProperties\"] is True\n+\ndef test_only_explicitly_declared_fields_are_translated(self, openapi):\nclass UserSchema(Schema):\n_id = fields.Int()\n" } ]
Python
MIT License
marshmallow-code/apispec
Populate additionalProperties from Meta.unknown (#635) Derive the value of additionalProperties from Meta.unknown, if defined. additionalProperties will be true only if Meta.unknown == INCLUDE
393,994
21.03.2021 14:41:03
-32,400
381dd89489893a0f1e05e2a3f6efee831e69666b
Allow to_yaml to pass options to yaml.dump
[ { "change_type": "MODIFY", "old_path": "src/apispec/core.py", "new_path": "src/apispec/core.py", "diff": "@@ -238,11 +238,14 @@ class APISpec:\nret = deepupdate(ret, self.options)\nreturn ret\n- def to_yaml(self):\n- \"\"\"Render the spec to YAML. Requires PyYAML to be installed.\"\"\"\n+ def to_yaml(self, yaml_dump_kwargs=None):\n+ \"\"\"Render the spec to YAML. Requires PyYAML to be installed.\n+\n+ :param dict yaml_dump_kwargs: Additional keyword arguments to pass to `yaml.dump`\n+ \"\"\"\nfrom .yaml_utils import dict_to_yaml\n- return dict_to_yaml(self.to_dict())\n+ return dict_to_yaml(self.to_dict(), yaml_dump_kwargs)\ndef tag(self, tag):\n\"\"\" Store information about a tag.\n" }, { "change_type": "MODIFY", "old_path": "src/apispec/yaml_utils.py", "new_path": "src/apispec/yaml_utils.py", "diff": "@@ -15,8 +15,10 @@ class YAMLDumper(yaml.Dumper):\nyaml.add_representer(OrderedDict, YAMLDumper._represent_dict, Dumper=YAMLDumper)\n-def dict_to_yaml(dic):\n- return yaml.dump(dic, Dumper=YAMLDumper)\n+def dict_to_yaml(dic, yaml_dump_kwargs=None):\n+ if yaml_dump_kwargs is None:\n+ yaml_dump_kwargs = {}\n+ return yaml.dump(dic, Dumper=YAMLDumper, **yaml_dump_kwargs)\ndef load_yaml_from_docstring(docstring):\n" } ]
Python
MIT License
marshmallow-code/apispec
Allow to_yaml to pass options to yaml.dump
393,994
21.03.2021 14:48:27
-32,400
fb7fdcafdef9420d595cc05c88909955c5cf2362
Add pbzweihander to authors
[ { "change_type": "MODIFY", "old_path": "AUTHORS.rst", "new_path": "AUTHORS.rst", "diff": "@@ -67,3 +67,4 @@ Contributors (chronological)\n- David Bishop `@teancom <https://github.com/teancom>`_\n- Andrea Ghensi `@sanzoghenzo <https://github.com/sanzoghenzo>`_\n- `@timsilvers <https://github.com/timsilvers>`_\n+- Kangwook Lee `@pbzweihander <https://github.com/pbzweihander>`_\n" } ]
Python
MIT License
marshmallow-code/apispec
Add pbzweihander to authors
393,990
24.05.2021 22:52:54
-7,200
d80571d199b1043a4238b67d88882820d5f07d5e
Respect partial in _field2parameter
[ { "change_type": "MODIFY", "old_path": "AUTHORS.rst", "new_path": "AUTHORS.rst", "diff": "@@ -70,3 +70,4 @@ Contributors (chronological)\n- Kangwook Lee `@pbzweihander <https://github.com/pbzweihander>`_\n- Martijn Pieters `@mjpieters <https://github.com/mjpieters>`_\n- Duncan Booth `@kupuguy <https://github.com/kupuguy>`_\n+- Luke Whitehorn `<https://github.com/Anti-Distinctlyminty>`_\n" }, { "change_type": "MODIFY", "old_path": "src/apispec/ext/marshmallow/openapi.py", "new_path": "src/apispec/ext/marshmallow/openapi.py", "diff": "@@ -143,6 +143,10 @@ class OpenAPIConverter(FieldConverterMixin):\n\"\"\"\nret = {\"in\": location, \"name\": name, \"required\": field.required}\n+ partial = getattr(field.parent, \"partial\", False)\n+ if partial is True or (is_collection(partial) and field.name in partial):\n+ ret[\"required\"] = False\n+\nprop = self.field2property(field)\nmultiple = isinstance(field, marshmallow.fields.List)\n" }, { "change_type": "MODIFY", "old_path": "tests/test_ext_marshmallow_openapi.py", "new_path": "tests/test_ext_marshmallow_openapi.py", "diff": "@@ -229,6 +229,18 @@ class TestMarshmallowSchemaToParameters:\nres = openapi._field2parameter(field, name=\"field\", location=\"query\")\nassert res[\"required\"] is True\n+ def test_schema_partial(self, openapi):\n+ class UserSchema(Schema):\n+ field = fields.Str(required=True)\n+\n+ res_nodump = openapi.schema2parameters(\n+ UserSchema(partial=True), location=\"query\"\n+ )\n+\n+ assert len(res_nodump)\n+ param = res_nodump[0]\n+ assert param[\"required\"] is False\n+\n# json/body is invalid for OpenAPI 3\[email protected](\"openapi\", (\"2.0\",), indirect=True)\ndef test_schema_body(self, openapi):\n" } ]
Python
MIT License
marshmallow-code/apispec
Respect partial in _field2parameter
393,981
08.06.2021 17:58:13
-3,600
91a2c4b665862bce42a71fc6bfa4de466fbbc7ed
Add support for marshmallow.fields.Pluck() Pluck is essentially a transplanted field from another schema.
[ { "change_type": "MODIFY", "old_path": "src/apispec/ext/marshmallow/field_converter.py", "new_path": "src/apispec/ext/marshmallow/field_converter.py", "diff": "@@ -96,6 +96,7 @@ class FieldConverterMixin:\nself.field2pattern,\nself.metadata2properties,\nself.nested2properties,\n+ self.pluck2properties,\nself.list2properties,\nself.dict2properties,\n]\n@@ -402,7 +403,11 @@ class FieldConverterMixin:\n:param Field field: A marshmallow field.\n:rtype: dict\n\"\"\"\n- if isinstance(field, marshmallow.fields.Nested):\n+ # Pluck is a subclass of Nested but is in essence a single field; it\n+ # is treated separately by pluck2properties.\n+ if isinstance(field, marshmallow.fields.Nested) and not isinstance(\n+ field, marshmallow.fields.Pluck\n+ ):\nschema_dict = self.resolve_nested_schema(field.schema)\nif ret and \"$ref\" in schema_dict:\nret.update({\"allOf\": [schema_dict]})\n@@ -410,6 +415,21 @@ class FieldConverterMixin:\nret.update(schema_dict)\nreturn ret\n+ def pluck2properties(self, field, **kwargs):\n+ \"\"\"Return a dictionary of properties from :class:`Pluck <marshmallow.fields.Pluck` fields.\n+\n+ Pluck effectively trans-includes a field from another schema into this,\n+ possibly wrapped in an array (`many=True`).\n+\n+ :param Field field: A marshmallow field.\n+ :rtype: dict\n+ \"\"\"\n+ if isinstance(field, marshmallow.fields.Pluck):\n+ plucked_field = field.schema.fields[field.field_name]\n+ ret = self.field2property(plucked_field)\n+ return {\"type\": \"array\", \"items\": ret} if field.many else ret\n+ return {}\n+\ndef list2properties(self, field, **kwargs):\n\"\"\"Return a dictionary of properties from :class:`List <marshmallow.fields.List>` fields.\n" }, { "change_type": "MODIFY", "old_path": "tests/test_ext_marshmallow_field.py", "new_path": "tests/test_ext_marshmallow_field.py", "diff": "@@ -5,7 +5,7 @@ import pytest\nfrom marshmallow import fields, validate\nfrom .schemas import CategorySchema, CustomList, CustomStringField, CustomIntegerField\n-from .utils import build_ref\n+from .utils import build_ref, get_schemas\ndef test_field2choices_preserving_order(openapi):\n@@ -318,6 +318,52 @@ def test_nested_field_with_property(spec_fixture):\n}\n+class TestField2PropertyPluck:\n+ @pytest.fixture(autouse=True)\n+ def _setup(self, spec_fixture):\n+ self.field2property = spec_fixture.openapi.field2property\n+\n+ self.spec = spec_fixture.spec\n+ self.spec.components.schema(\"Category\", schema=CategorySchema)\n+ self.unplucked = get_schemas(self.spec)[\"Category\"][\"properties\"][\"breed\"]\n+\n+ def test_spec(self, spec_fixture):\n+ breed = fields.Pluck(CategorySchema, \"breed\")\n+ assert self.field2property(breed) == self.unplucked\n+\n+ def test_with_property(self):\n+ breed = fields.Pluck(CategorySchema, \"breed\", dump_only=True)\n+ assert self.field2property(breed) == {**self.unplucked, \"readOnly\": True}\n+\n+ def test_metadata(self):\n+ breed = fields.Pluck(\n+ CategorySchema,\n+ \"breed\",\n+ metadata={\n+ \"description\": \"Category breed\",\n+ \"invalid_property\": \"not in the result\",\n+ \"x_extension\": \"A great extension\",\n+ },\n+ )\n+ assert self.field2property(breed) == {\n+ **self.unplucked,\n+ \"description\": \"Category breed\",\n+ \"x-extension\": \"A great extension\",\n+ }\n+\n+ def test_many(self):\n+ breed = fields.Pluck(CategorySchema, \"breed\", many=True)\n+ assert self.field2property(breed) == {\"type\": \"array\", \"items\": self.unplucked}\n+\n+ def test_many_with_property(self):\n+ breed = fields.Pluck(CategorySchema, \"breed\", many=True, dump_only=True)\n+ assert self.field2property(breed) == {\n+ \"items\": self.unplucked,\n+ \"type\": \"array\",\n+ \"readOnly\": True,\n+ }\n+\n+\ndef test_custom_properties_for_custom_fields(spec_fixture):\ndef custom_string2properties(self, field, **kwargs):\nret = {}\n" }, { "change_type": "MODIFY", "old_path": "tests/test_ext_marshmallow_openapi.py", "new_path": "tests/test_ext_marshmallow_openapi.py", "diff": "@@ -391,6 +391,16 @@ class TestNesting:\nassert (\"i\" in props) == (modifier == \"only\")\nassert (\"j\" not in props) == (modifier == \"only\")\n+ def test_schema2jsonschema_with_plucked_field(self, spec_fixture):\n+ class PetSchema(Schema):\n+ breed = fields.Pluck(CategorySchema, \"breed\")\n+\n+ category_schema = spec_fixture.openapi.schema2jsonschema(CategorySchema)\n+ pet_schema = spec_fixture.openapi.schema2jsonschema(PetSchema)\n+ assert (\n+ pet_schema[\"properties\"][\"breed\"] == category_schema[\"properties\"][\"breed\"]\n+ )\n+\ndef test_schema2jsonschema_with_nested_fields_with_adhoc_changes(\nself, spec_fixture\n):\n@@ -414,6 +424,20 @@ class TestNesting:\nCategorySchema\n)\n+ def test_schema2jsonschema_with_plucked_fields_with_adhoc_changes(\n+ self, spec_fixture\n+ ):\n+ category_schema = CategorySchema()\n+ category_schema.fields[\"breed\"].dump_only = True\n+\n+ class PetSchema(Schema):\n+ breed = fields.Pluck(category_schema, \"breed\", many=True)\n+\n+ spec_fixture.spec.components.schema(\"Pet\", schema=PetSchema)\n+ props = get_schemas(spec_fixture.spec)[\"Pet\"][\"properties\"]\n+\n+ assert props[\"breed\"][\"items\"][\"readOnly\"] is True\n+\ndef test_schema2jsonschema_with_nested_excluded_fields(self, spec):\ncategory_schema = CategorySchema(exclude=(\"breed\",))\n" } ]
Python
MIT License
marshmallow-code/apispec
Add support for marshmallow.fields.Pluck() Pluck is essentially a transplanted field from another schema.
394,007
17.06.2021 17:06:46
-7,200
6471ebecbfd450ba7bc543452e8105fd56bbe25a
Fix links to PR and issues in the CHANGELOG file The PR 651 and the issue 627 have now a valid link. Linkid is added to the AUTHORS file too.
[ { "change_type": "MODIFY", "old_path": "CHANGELOG.rst", "new_path": "CHANGELOG.rst", "diff": "@@ -53,7 +53,7 @@ Features:\n- Allow ``to_yaml`` to pass kwargs to ``yaml.dump`` (:pr:`648`).\n- Resolve header references in responses (:pr:`650`).\n- Resolve example references in parameters, request bodies and responses\n- (:pr:`#651`).\n+ (:pr:`651`).\n4.3.0 (2021-02-10)\n******************\n" } ]
Python
MIT License
marshmallow-code/apispec
Fix links to PR and issues in the CHANGELOG file The PR 651 and the issue 627 have now a valid link. Linkid is added to the AUTHORS file too.
394,023
19.06.2021 03:03:31
0
1f26216182ddf74a50803793decc28b6fc850e96
fix year on changelog Looks like someone got the year mixed up on the release! Thank goodness it's really 2021 and not 2020 anymore!
[ { "change_type": "MODIFY", "old_path": "CHANGELOG.rst", "new_path": "CHANGELOG.rst", "diff": "Changelog\n---------\n-4.6.0 (2020-06-14)\n+4.6.0 (2021-06-14)\n******************\nFeatures:\n@@ -9,7 +9,7 @@ Features:\n- Support `Pluck` field (:pr:`677`). Thanks :user:`mjpieters` for the PR.\n- Support `TimeDelta` field (:pr:`678`).\n-4.5.0 (2020-06-04)\n+4.5.0 (2021-06-04)\n******************\nFeatures:\n@@ -27,7 +27,7 @@ Other changes:\ndeprecated since marshmallow 3.10. apispec is still compatible with\nmarshmallow >=3,<3.10 but tests now require marshmallow >=3.10. (:pr:`675`)\n-4.4.2 (2020-05-24)\n+4.4.2 (2021-05-24)\n******************\nBug fixes:\n@@ -35,7 +35,7 @@ Bug fixes:\n- Respect ``partial`` marshmallow schema parameter: don't document the field as\nrequired. (:issue:`627`). Thanks :user:`Anti-Distinctlyminty` for the PR.\n-4.4.1 (2020-05-07)\n+4.4.1 (2021-05-07)\n******************\nBug fixes:\n@@ -43,7 +43,7 @@ Bug fixes:\n- Don't set ``additionalProperties`` if ``Meta.unknown`` is ``EXCLUDE``\n(:issue:`659`). Thanks :user:`kupuguy` for the PR.\n-4.4.0 (2020-03-31)\n+4.4.0 (2021-03-31)\n******************\nFeatures:\n" } ]
Python
MIT License
marshmallow-code/apispec
fix year on changelog Looks like someone got the year mixed up on the release! Thank goodness it's really 2021 and not 2020 anymore!
393,981
02.07.2021 17:27:11
-3,600
0c580e4bbc8de1e71227c3fa3cff9a1ecd7c800d
Correct spelling of 'null' In OpenAPI 3.1, a nullable type has multiple values for the `type` field; the base type string, and the string value `'null'`. The quotes are not part of the value however, they are part of the serialisation format (so, `"null"` in JSON). Remove the extraneous quotes.
[ { "change_type": "MODIFY", "old_path": "src/apispec/ext/marshmallow/field_converter.py", "new_path": "src/apispec/ext/marshmallow/field_converter.py", "diff": "@@ -280,7 +280,7 @@ class FieldConverterMixin:\nelif self.openapi_version.minor < 1:\nattributes[\"nullable\"] = True\nelse:\n- attributes[\"type\"] = make_type_list(ret.get(\"type\")) + [\"'null'\"]\n+ attributes[\"type\"] = [*make_type_list(ret.get(\"type\")), \"null\"]\nreturn attributes\ndef field2range(self, field, ret):\n" }, { "change_type": "MODIFY", "old_path": "tests/test_ext_marshmallow_field.py", "new_path": "tests/test_ext_marshmallow_field.py", "diff": "@@ -173,7 +173,7 @@ def test_field_with_allow_none(spec_fixture):\nassert res[\"nullable\"] is True\nelse:\nassert \"nullable\" not in res\n- assert res[\"type\"] == [\"string\", \"'null'\"]\n+ assert res[\"type\"] == [\"string\", \"null\"]\ndef test_field_with_dump_only(spec_fixture):\n@@ -211,7 +211,7 @@ def test_field_with_range_string_type(spec_fixture, field):\[email protected](\"spec_fixture\", (\"3.1.0\",), indirect=True)\ndef test_field_with_range_type_list_with_number(spec_fixture):\n- @spec_fixture.openapi.map_to_openapi_type([\"integer\", \"'null'\"], None)\n+ @spec_fixture.openapi.map_to_openapi_type([\"integer\", \"null\"], None)\nclass NullableInteger(fields.Field):\n\"\"\"Nullable integer\"\"\"\n@@ -219,12 +219,12 @@ def test_field_with_range_type_list_with_number(spec_fixture):\nres = spec_fixture.openapi.field2property(field)\nassert res[\"minimum\"] == 1\nassert res[\"maximum\"] == 10\n- assert res[\"type\"] == [\"integer\", \"'null'\"]\n+ assert res[\"type\"] == [\"integer\", \"null\"]\[email protected](\"spec_fixture\", (\"3.1.0\",), indirect=True)\ndef test_field_with_range_type_list_without_number(spec_fixture):\n- @spec_fixture.openapi.map_to_openapi_type([\"string\", \"'null'\"], None)\n+ @spec_fixture.openapi.map_to_openapi_type([\"string\", \"null\"], None)\nclass NullableInteger(fields.Field):\n\"\"\"Nullable integer\"\"\"\n@@ -232,7 +232,7 @@ def test_field_with_range_type_list_without_number(spec_fixture):\nres = spec_fixture.openapi.field2property(field)\nassert res[\"x-minimum\"] == 1\nassert res[\"x-maximum\"] == 10\n- assert res[\"type\"] == [\"string\", \"'null'\"]\n+ assert res[\"type\"] == [\"string\", \"null\"]\ndef test_field_with_str_regex(spec_fixture):\n" } ]
Python
MIT License
marshmallow-code/apispec
Correct spelling of 'null' In OpenAPI 3.1, a nullable type has multiple values for the `type` field; the base type string, and the string value `'null'`. The quotes are not part of the value however, they are part of the serialisation format (so, `"null"` in JSON). Remove the extraneous quotes.
393,983
12.05.2022 08:53:27
-36,000
b78019106bdacc70d3d9222feb459f2859e0832f
Set default yaml.dump sort_keys kwarg to False to respect dictionary ordering
[ { "change_type": "MODIFY", "old_path": "src/apispec/yaml_utils.py", "new_path": "src/apispec/yaml_utils.py", "diff": "@@ -9,8 +9,11 @@ from apispec.utils import trim_docstring, dedent\ndef dict_to_yaml(dic: dict, yaml_dump_kwargs: typing.Any | None = None) -> str:\n- if yaml_dump_kwargs is None:\n- yaml_dump_kwargs = {}\n+ \"\"\"Serializes a dictionary to YAML.\"\"\"\n+ yaml_dump_kwargs = yaml_dump_kwargs or {}\n+\n+ # By default, don't sort alphabetically to respect schema field ordering\n+ yaml_dump_kwargs.setdefault(\"sort_keys\", False)\nreturn yaml.dump(dic, **yaml_dump_kwargs)\n" } ]
Python
MIT License
marshmallow-code/apispec
Set default yaml.dump sort_keys kwarg to False to respect dictionary ordering
394,027
10.11.2022 17:06:58
-3,600
b3ecd0aa4bc96cc1ecbc50385f5105967b347148
Allow openapi_version as str in marshmallow OpenAPIConverter Fix
[ { "change_type": "MODIFY", "old_path": "src/apispec/ext/marshmallow/openapi.py", "new_path": "src/apispec/ext/marshmallow/openapi.py", "diff": "@@ -40,7 +40,7 @@ __location_map__ = {\nclass OpenAPIConverter(FieldConverterMixin):\n\"\"\"Adds methods for generating OpenAPI specification from marshmallow schemas and fields.\n- :param Version openapi_version: The OpenAPI version to use.\n+ :param Version|str openapi_version: The OpenAPI version to use.\nShould be in the form '2.x' or '3.x.x' to comply with the OpenAPI standard.\n:param callable schema_name_resolver: Callable to generate the schema definition name.\nReceives the `Schema` class and returns the name to be used in refs within\n@@ -52,11 +52,15 @@ class OpenAPIConverter(FieldConverterMixin):\ndef __init__(\nself,\n- openapi_version: Version,\n+ openapi_version: Version | str,\nschema_name_resolver,\nspec: APISpec,\n) -> None:\n- self.openapi_version = openapi_version\n+ self.openapi_version = (\n+ Version(openapi_version)\n+ if isinstance(openapi_version, str)\n+ else openapi_version\n+ )\nself.schema_name_resolver = schema_name_resolver\nself.spec = spec\nself.init_attribute_functions()\n" }, { "change_type": "MODIFY", "old_path": "tests/test_ext_marshmallow_openapi.py", "new_path": "tests/test_ext_marshmallow_openapi.py", "diff": "@@ -4,8 +4,9 @@ import pytest\nfrom marshmallow import EXCLUDE, fields, INCLUDE, RAISE, Schema, validate\n-from apispec.ext.marshmallow import MarshmallowPlugin\n+from apispec.ext.marshmallow import MarshmallowPlugin, OpenAPIConverter\nfrom apispec import exceptions, APISpec\n+from packaging.version import Version\nfrom .schemas import CustomList, CustomStringField\nfrom .utils import get_schemas, build_ref, validate_spec\n@@ -608,6 +609,15 @@ def test_openapi_tools_validate_v3():\npytest.fail(str(error))\n+def test_openapi_converter_openapi_version_types():\n+ converter_with_version = OpenAPIConverter(Version(\"3.1\"), None, None)\n+ converter_with_str_version = OpenAPIConverter(\"3.1\", None, None)\n+ assert (\n+ converter_with_version.openapi_version\n+ == converter_with_str_version.openapi_version\n+ )\n+\n+\nclass TestFieldValidation:\nclass ValidationSchema(Schema):\nid = fields.Int(dump_only=True)\n" } ]
Python
MIT License
marshmallow-code/apispec
Allow openapi_version as str in marshmallow OpenAPIConverter Fix #810
300,595
12.12.2021 17:17:30
-3,600
f60c7bbaaded8edfcc5a28ca96df4f563067531c
adds missing import for SoftDeletes trait
[ { "change_type": "MODIFY", "old_path": "Console/PruneCommand.php", "new_path": "Console/PruneCommand.php", "diff": "@@ -6,6 +6,7 @@ use Illuminate\\Console\\Command;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Database\\Eloquent\\MassPrunable;\nuse Illuminate\\Database\\Eloquent\\Prunable;\n+use Illuminate\\Database\\Eloquent\\SoftDeletes;\nuse Illuminate\\Database\\Events\\ModelsPruned;\nuse Illuminate\\Support\\Str;\nuse Symfony\\Component\\Finder\\Finder;\n" } ]
PHP
MIT License
illuminate/database
adds missing import for SoftDeletes trait (#39991)
300,611
17.03.2022 20:27:26
0
930cb61f3e4200c41b3864f75a04bcadd584623c
add an argument to pass the desired relation name on `morphToMany` and `morphedByMany`
[ { "change_type": "MODIFY", "old_path": "Eloquent/Concerns/HasRelationships.php", "new_path": "Eloquent/Concerns/HasRelationships.php", "diff": "@@ -536,14 +536,18 @@ trait HasRelationships\n* @param string|null $relatedPivotKey\n* @param string|null $parentKey\n* @param string|null $relatedKey\n+ * @param string|null $relation\n* @param bool $inverse\n* @return \\Illuminate\\Database\\Eloquent\\Relations\\MorphToMany\n*/\npublic function morphToMany($related, $name, $table = null, $foreignPivotKey = null,\n$relatedPivotKey = null, $parentKey = null,\n- $relatedKey = null, $inverse = false)\n+ $relatedKey = null, $relation = null, $inverse = false)\n{\n- $caller = $this->guessBelongsToManyRelation();\n+ // If no relationship name was passed, we will pull backtraces to get the\n+ // name of the calling function. We will use that function name as the\n+ // title of this relation since that is a great convention to apply.\n+ $relation = $relation ?: $this->guessBelongsToManyRelation();\n// First, we will need to determine the foreign key and \"other key\" for the\n// relationship. Once we have determined the keys we will make the query\n@@ -568,7 +572,7 @@ trait HasRelationships\nreturn $this->newMorphToMany(\n$instance->newQuery(), $this, $name, $table,\n$foreignPivotKey, $relatedPivotKey, $parentKey ?: $this->getKeyName(),\n- $relatedKey ?: $instance->getKeyName(), $caller, $inverse\n+ $relatedKey ?: $instance->getKeyName(), $relation, $inverse\n);\n}\n@@ -605,10 +609,11 @@ trait HasRelationships\n* @param string|null $relatedPivotKey\n* @param string|null $parentKey\n* @param string|null $relatedKey\n+ * @param string|null $relation\n* @return \\Illuminate\\Database\\Eloquent\\Relations\\MorphToMany\n*/\npublic function morphedByMany($related, $name, $table = null, $foreignPivotKey = null,\n- $relatedPivotKey = null, $parentKey = null, $relatedKey = null)\n+ $relatedPivotKey = null, $parentKey = null, $relatedKey = null, $relation = null)\n{\n$foreignPivotKey = $foreignPivotKey ?: $this->getForeignKey();\n@@ -619,7 +624,7 @@ trait HasRelationships\nreturn $this->morphToMany(\n$related, $name, $table, $foreignPivotKey,\n- $relatedPivotKey, $parentKey, $relatedKey, true\n+ $relatedPivotKey, $parentKey, $relatedKey, $relation, true\n);\n}\n" } ]
PHP
MIT License
illuminate/database
add an argument to pass the desired relation name on `morphToMany` and `morphedByMany` (#41490)
300,560
19.07.2022 14:05:02
0
ee0753e6d6dbf469b610b8be78d4c728d996ebc8
[10.x] Add connection name to QueryException
[ { "change_type": "MODIFY", "old_path": "Connection.php", "new_path": "Connection.php", "diff": "@@ -757,7 +757,7 @@ class Connection implements ConnectionInterface\n// lot more helpful to the developer instead of just the database's errors.\ncatch (Exception $e) {\nthrow new QueryException(\n- $query, $this->prepareBindings($bindings), $e\n+ $this->getName(), $query, $this->prepareBindings($bindings), $e\n);\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "QueryException.php", "new_path": "QueryException.php", "diff": "@@ -8,6 +8,13 @@ use Throwable;\nclass QueryException extends PDOException\n{\n+ /**\n+ * The database connection name.\n+ *\n+ * @var string\n+ */\n+ protected $connectionName;\n+\n/**\n* The SQL for the query.\n*\n@@ -25,19 +32,21 @@ class QueryException extends PDOException\n/**\n* Create a new query exception instance.\n*\n+ * @param string $connectionName\n* @param string $sql\n* @param array $bindings\n* @param \\Throwable $previous\n* @return void\n*/\n- public function __construct($sql, array $bindings, Throwable $previous)\n+ public function __construct($connectionName, $sql, array $bindings, Throwable $previous)\n{\nparent::__construct('', 0, $previous);\n+ $this->connectionName = $connectionName;\n$this->sql = $sql;\n$this->bindings = $bindings;\n$this->code = $previous->getCode();\n- $this->message = $this->formatMessage($sql, $bindings, $previous);\n+ $this->message = $this->formatMessage($connectionName, $sql, $bindings, $previous);\nif ($previous instanceof PDOException) {\n$this->errorInfo = $previous->errorInfo;\n@@ -47,14 +56,25 @@ class QueryException extends PDOException\n/**\n* Format the SQL error message.\n*\n+ * @param string $connectionName\n* @param string $sql\n* @param array $bindings\n* @param \\Throwable $previous\n* @return string\n*/\n- protected function formatMessage($sql, $bindings, Throwable $previous)\n+ protected function formatMessage($connectionName, $sql, $bindings, Throwable $previous)\n+ {\n+ return $previous->getMessage().' (Connection: '.$connectionName.', SQL: '.Str::replaceArray('?', $bindings, $sql).')';\n+ }\n+\n+ /**\n+ * Get the connection name for the query.\n+ *\n+ * @return string\n+ */\n+ public function getConnectionName()\n{\n- return $previous->getMessage().' (SQL: '.Str::replaceArray('?', $bindings, $sql).')';\n+ return $this->connectionName;\n}\n/**\n" } ]
PHP
MIT License
illuminate/database
[10.x] Add connection name to QueryException (#43190)
300,566
20.12.2022 17:38:10
-3,600
789b9b178da639aa2353376ef235665417af73b5
Support builder as param on whereExists
[ { "change_type": "MODIFY", "old_path": "Query/Builder.php", "new_path": "Query/Builder.php", "diff": "@@ -1617,19 +1617,23 @@ class Builder implements BuilderContract\n/**\n* Add an exists clause to the query.\n*\n- * @param \\Closure $callback\n+ * @param \\Closure|\\Illuminate\\Database\\Query\\Builder|\\Illuminate\\Database\\Eloquent\\Builder $callback\n* @param string $boolean\n* @param bool $not\n* @return $this\n*/\n- public function whereExists(Closure $callback, $boolean = 'and', $not = false)\n+ public function whereExists($callback, $boolean = 'and', $not = false)\n{\n+ if ($callback instanceof Closure) {\n$query = $this->forSubQuery();\n// Similar to the sub-select clause, we will create a new query instance so\n// the developer may cleanly specify the entire exists query and we will\n// compile the whole thing in the grammar and insert it into the SQL.\n$callback($query);\n+ } else {\n+ $query = $callback;\n+ }\nreturn $this->addWhereExistsQuery($query, $boolean, $not);\n}\n@@ -1637,11 +1641,11 @@ class Builder implements BuilderContract\n/**\n* Add an or exists clause to the query.\n*\n- * @param \\Closure $callback\n+ * @param \\Closure|\\Illuminate\\Database\\Query\\Builder|\\Illuminate\\Database\\Eloquent\\Builder $callback\n* @param bool $not\n* @return $this\n*/\n- public function orWhereExists(Closure $callback, $not = false)\n+ public function orWhereExists($callback, $not = false)\n{\nreturn $this->whereExists($callback, 'or', $not);\n}\n@@ -1649,11 +1653,11 @@ class Builder implements BuilderContract\n/**\n* Add a where not exists clause to the query.\n*\n- * @param \\Closure $callback\n+ * @param \\Closure|\\Illuminate\\Database\\Query\\Builder|\\Illuminate\\Database\\Eloquent\\Builder $callback\n* @param string $boolean\n* @return $this\n*/\n- public function whereNotExists(Closure $callback, $boolean = 'and')\n+ public function whereNotExists($callback, $boolean = 'and')\n{\nreturn $this->whereExists($callback, $boolean, true);\n}\n@@ -1661,10 +1665,10 @@ class Builder implements BuilderContract\n/**\n* Add a where not exists clause to the query.\n*\n- * @param \\Closure $callback\n+ * @param \\Closure|\\Illuminate\\Database\\Query\\Builder|\\Illuminate\\Database\\Eloquent\\Builder $callback\n* @return $this\n*/\n- public function orWhereNotExists(Closure $callback)\n+ public function orWhereNotExists($callback)\n{\nreturn $this->orWhereExists($callback, true);\n}\n" } ]
PHP
MIT License
illuminate/database
Support builder as param on whereExists (#45341)
300,868
04.02.2023 07:53:59
-46,800
0da5e80127b7a589b31d099956b27807868b921d
Add creation and update datetime columns Add datetimes function to create "created_at" and "updated_at" columns using "datetime" columns instead off "timestamps" columns to add further future proofing.
[ { "change_type": "MODIFY", "old_path": "Schema/Blueprint.php", "new_path": "Schema/Blueprint.php", "diff": "@@ -1203,6 +1203,19 @@ class Blueprint\n$this->timestampTz('updated_at', $precision)->nullable();\n}\n+ /**\n+ * Add creation and update datetime columns to the table.\n+ *\n+ * @param int|null $precision\n+ * @return void\n+ */\n+ public function datetimes($precision = 0)\n+ {\n+ $this->datetime('created_at', $precision)->nullable();\n+\n+ $this->datetime('updated_at', $precision)->nullable();\n+ }\n+\n/**\n* Add a \"deleted at\" timestamp for the table.\n*\n" } ]
PHP
MIT License
illuminate/database
Add creation and update datetime columns (#45947) Add datetimes function to create "created_at" and "updated_at" columns using "datetime" columns instead off "timestamps" columns to add further future proofing.
426,496
02.08.2019 09:38:57
-7,200
b428a2b201080eb6815be5c546f94e542c634081
Copied server implementation from the 'webmps-server' repository
[ { "change_type": "ADD", "old_path": null, "new_path": ".gitignore", "diff": "+workspace.xml\n+model/server/target\n" }, { "change_type": "ADD", "old_path": null, "new_path": "model/server/.idea/compiler.xml", "diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<project version=\"4\">\n+ <component name=\"CompilerConfiguration\">\n+ <annotationProcessing>\n+ <profile name=\"Maven default annotation processors profile\" enabled=\"true\">\n+ <sourceOutputDir name=\"target/generated-sources/annotations\" />\n+ <sourceTestOutputDir name=\"target/generated-test-sources/test-annotations\" />\n+ <outputRelativeToContentRoot value=\"true\" />\n+ <module name=\"webmps-server\" />\n+ </profile>\n+ </annotationProcessing>\n+ </component>\n+</project>\n\\ No newline at end of file\n" }, { "change_type": "ADD", "old_path": null, "new_path": "model/server/.idea/misc.xml", "diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<project version=\"4\">\n+ <component name=\"ExternalStorageConfigurationManager\" enabled=\"true\" />\n+ <component name=\"MavenProjectsManager\">\n+ <option name=\"originalFiles\">\n+ <list>\n+ <option value=\"$PROJECT_DIR$/pom.xml\" />\n+ </list>\n+ </option>\n+ </component>\n+ <component name=\"ProjectRootManager\" version=\"2\" languageLevel=\"JDK_1_8\" default=\"false\" project-jdk-name=\"1.8\" project-jdk-type=\"JavaSDK\">\n+ <output url=\"file://$PROJECT_DIR$/out\" />\n+ </component>\n+</project>\n\\ No newline at end of file\n" }, { "change_type": "ADD", "old_path": null, "new_path": "model/server/.idea/uiDesigner.xml", "diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<project version=\"4\">\n+ <component name=\"Palette2\">\n+ <group name=\"Swing\">\n+ <item class=\"com.intellij.uiDesigner.HSpacer\" tooltip-text=\"Horizontal Spacer\" icon=\"/com/intellij/uiDesigner/icons/hspacer.png\" removable=\"false\" auto-create-binding=\"false\" can-attach-label=\"false\">\n+ <default-constraints vsize-policy=\"1\" hsize-policy=\"6\" anchor=\"0\" fill=\"1\" />\n+ </item>\n+ <item class=\"com.intellij.uiDesigner.VSpacer\" tooltip-text=\"Vertical Spacer\" icon=\"/com/intellij/uiDesigner/icons/vspacer.png\" removable=\"false\" auto-create-binding=\"false\" can-attach-label=\"false\">\n+ <default-constraints vsize-policy=\"6\" hsize-policy=\"1\" anchor=\"0\" fill=\"2\" />\n+ </item>\n+ <item class=\"javax.swing.JPanel\" icon=\"/com/intellij/uiDesigner/icons/panel.png\" removable=\"false\" auto-create-binding=\"false\" can-attach-label=\"false\">\n+ <default-constraints vsize-policy=\"3\" hsize-policy=\"3\" anchor=\"0\" fill=\"3\" />\n+ </item>\n+ <item class=\"javax.swing.JScrollPane\" icon=\"/com/intellij/uiDesigner/icons/scrollPane.png\" removable=\"false\" auto-create-binding=\"false\" can-attach-label=\"true\">\n+ <default-constraints vsize-policy=\"7\" hsize-policy=\"7\" anchor=\"0\" fill=\"3\" />\n+ </item>\n+ <item class=\"javax.swing.JButton\" icon=\"/com/intellij/uiDesigner/icons/button.png\" removable=\"false\" auto-create-binding=\"true\" can-attach-label=\"false\">\n+ <default-constraints vsize-policy=\"0\" hsize-policy=\"3\" anchor=\"0\" fill=\"1\" />\n+ <initial-values>\n+ <property name=\"text\" value=\"Button\" />\n+ </initial-values>\n+ </item>\n+ <item class=\"javax.swing.JRadioButton\" icon=\"/com/intellij/uiDesigner/icons/radioButton.png\" removable=\"false\" auto-create-binding=\"true\" can-attach-label=\"false\">\n+ <default-constraints vsize-policy=\"0\" hsize-policy=\"3\" anchor=\"8\" fill=\"0\" />\n+ <initial-values>\n+ <property name=\"text\" value=\"RadioButton\" />\n+ </initial-values>\n+ </item>\n+ <item class=\"javax.swing.JCheckBox\" icon=\"/com/intellij/uiDesigner/icons/checkBox.png\" removable=\"false\" auto-create-binding=\"true\" can-attach-label=\"false\">\n+ <default-constraints vsize-policy=\"0\" hsize-policy=\"3\" anchor=\"8\" fill=\"0\" />\n+ <initial-values>\n+ <property name=\"text\" value=\"CheckBox\" />\n+ </initial-values>\n+ </item>\n+ <item class=\"javax.swing.JLabel\" icon=\"/com/intellij/uiDesigner/icons/label.png\" removable=\"false\" auto-create-binding=\"false\" can-attach-label=\"false\">\n+ <default-constraints vsize-policy=\"0\" hsize-policy=\"0\" anchor=\"8\" fill=\"0\" />\n+ <initial-values>\n+ <property name=\"text\" value=\"Label\" />\n+ </initial-values>\n+ </item>\n+ <item class=\"javax.swing.JTextField\" icon=\"/com/intellij/uiDesigner/icons/textField.png\" removable=\"false\" auto-create-binding=\"true\" can-attach-label=\"true\">\n+ <default-constraints vsize-policy=\"0\" hsize-policy=\"6\" anchor=\"8\" fill=\"1\">\n+ <preferred-size width=\"150\" height=\"-1\" />\n+ </default-constraints>\n+ </item>\n+ <item class=\"javax.swing.JPasswordField\" icon=\"/com/intellij/uiDesigner/icons/passwordField.png\" removable=\"false\" auto-create-binding=\"true\" can-attach-label=\"true\">\n+ <default-constraints vsize-policy=\"0\" hsize-policy=\"6\" anchor=\"8\" fill=\"1\">\n+ <preferred-size width=\"150\" height=\"-1\" />\n+ </default-constraints>\n+ </item>\n+ <item class=\"javax.swing.JFormattedTextField\" icon=\"/com/intellij/uiDesigner/icons/formattedTextField.png\" removable=\"false\" auto-create-binding=\"true\" can-attach-label=\"true\">\n+ <default-constraints vsize-policy=\"0\" hsize-policy=\"6\" anchor=\"8\" fill=\"1\">\n+ <preferred-size width=\"150\" height=\"-1\" />\n+ </default-constraints>\n+ </item>\n+ <item class=\"javax.swing.JTextArea\" icon=\"/com/intellij/uiDesigner/icons/textArea.png\" removable=\"false\" auto-create-binding=\"true\" can-attach-label=\"true\">\n+ <default-constraints vsize-policy=\"6\" hsize-policy=\"6\" anchor=\"0\" fill=\"3\">\n+ <preferred-size width=\"150\" height=\"50\" />\n+ </default-constraints>\n+ </item>\n+ <item class=\"javax.swing.JTextPane\" icon=\"/com/intellij/uiDesigner/icons/textPane.png\" removable=\"false\" auto-create-binding=\"true\" can-attach-label=\"true\">\n+ <default-constraints vsize-policy=\"6\" hsize-policy=\"6\" anchor=\"0\" fill=\"3\">\n+ <preferred-size width=\"150\" height=\"50\" />\n+ </default-constraints>\n+ </item>\n+ <item class=\"javax.swing.JEditorPane\" icon=\"/com/intellij/uiDesigner/icons/editorPane.png\" removable=\"false\" auto-create-binding=\"true\" can-attach-label=\"true\">\n+ <default-constraints vsize-policy=\"6\" hsize-policy=\"6\" anchor=\"0\" fill=\"3\">\n+ <preferred-size width=\"150\" height=\"50\" />\n+ </default-constraints>\n+ </item>\n+ <item class=\"javax.swing.JComboBox\" icon=\"/com/intellij/uiDesigner/icons/comboBox.png\" removable=\"false\" auto-create-binding=\"true\" can-attach-label=\"true\">\n+ <default-constraints vsize-policy=\"0\" hsize-policy=\"2\" anchor=\"8\" fill=\"1\" />\n+ </item>\n+ <item class=\"javax.swing.JTable\" icon=\"/com/intellij/uiDesigner/icons/table.png\" removable=\"false\" auto-create-binding=\"true\" can-attach-label=\"false\">\n+ <default-constraints vsize-policy=\"6\" hsize-policy=\"6\" anchor=\"0\" fill=\"3\">\n+ <preferred-size width=\"150\" height=\"50\" />\n+ </default-constraints>\n+ </item>\n+ <item class=\"javax.swing.JList\" icon=\"/com/intellij/uiDesigner/icons/list.png\" removable=\"false\" auto-create-binding=\"true\" can-attach-label=\"false\">\n+ <default-constraints vsize-policy=\"6\" hsize-policy=\"2\" anchor=\"0\" fill=\"3\">\n+ <preferred-size width=\"150\" height=\"50\" />\n+ </default-constraints>\n+ </item>\n+ <item class=\"javax.swing.JTree\" icon=\"/com/intellij/uiDesigner/icons/tree.png\" removable=\"false\" auto-create-binding=\"true\" can-attach-label=\"false\">\n+ <default-constraints vsize-policy=\"6\" hsize-policy=\"6\" anchor=\"0\" fill=\"3\">\n+ <preferred-size width=\"150\" height=\"50\" />\n+ </default-constraints>\n+ </item>\n+ <item class=\"javax.swing.JTabbedPane\" icon=\"/com/intellij/uiDesigner/icons/tabbedPane.png\" removable=\"false\" auto-create-binding=\"true\" can-attach-label=\"false\">\n+ <default-constraints vsize-policy=\"3\" hsize-policy=\"3\" anchor=\"0\" fill=\"3\">\n+ <preferred-size width=\"200\" height=\"200\" />\n+ </default-constraints>\n+ </item>\n+ <item class=\"javax.swing.JSplitPane\" icon=\"/com/intellij/uiDesigner/icons/splitPane.png\" removable=\"false\" auto-create-binding=\"false\" can-attach-label=\"false\">\n+ <default-constraints vsize-policy=\"3\" hsize-policy=\"3\" anchor=\"0\" fill=\"3\">\n+ <preferred-size width=\"200\" height=\"200\" />\n+ </default-constraints>\n+ </item>\n+ <item class=\"javax.swing.JSpinner\" icon=\"/com/intellij/uiDesigner/icons/spinner.png\" removable=\"false\" auto-create-binding=\"true\" can-attach-label=\"true\">\n+ <default-constraints vsize-policy=\"0\" hsize-policy=\"6\" anchor=\"8\" fill=\"1\" />\n+ </item>\n+ <item class=\"javax.swing.JSlider\" icon=\"/com/intellij/uiDesigner/icons/slider.png\" removable=\"false\" auto-create-binding=\"true\" can-attach-label=\"false\">\n+ <default-constraints vsize-policy=\"0\" hsize-policy=\"6\" anchor=\"8\" fill=\"1\" />\n+ </item>\n+ <item class=\"javax.swing.JSeparator\" icon=\"/com/intellij/uiDesigner/icons/separator.png\" removable=\"false\" auto-create-binding=\"false\" can-attach-label=\"false\">\n+ <default-constraints vsize-policy=\"6\" hsize-policy=\"6\" anchor=\"0\" fill=\"3\" />\n+ </item>\n+ <item class=\"javax.swing.JProgressBar\" icon=\"/com/intellij/uiDesigner/icons/progressbar.png\" removable=\"false\" auto-create-binding=\"true\" can-attach-label=\"false\">\n+ <default-constraints vsize-policy=\"0\" hsize-policy=\"6\" anchor=\"0\" fill=\"1\" />\n+ </item>\n+ <item class=\"javax.swing.JToolBar\" icon=\"/com/intellij/uiDesigner/icons/toolbar.png\" removable=\"false\" auto-create-binding=\"false\" can-attach-label=\"false\">\n+ <default-constraints vsize-policy=\"0\" hsize-policy=\"6\" anchor=\"0\" fill=\"1\">\n+ <preferred-size width=\"-1\" height=\"20\" />\n+ </default-constraints>\n+ </item>\n+ <item class=\"javax.swing.JToolBar$Separator\" icon=\"/com/intellij/uiDesigner/icons/toolbarSeparator.png\" removable=\"false\" auto-create-binding=\"false\" can-attach-label=\"false\">\n+ <default-constraints vsize-policy=\"0\" hsize-policy=\"0\" anchor=\"0\" fill=\"1\" />\n+ </item>\n+ <item class=\"javax.swing.JScrollBar\" icon=\"/com/intellij/uiDesigner/icons/scrollbar.png\" removable=\"false\" auto-create-binding=\"true\" can-attach-label=\"false\">\n+ <default-constraints vsize-policy=\"6\" hsize-policy=\"0\" anchor=\"0\" fill=\"2\" />\n+ </item>\n+ </group>\n+ </component>\n+</project>\n\\ No newline at end of file\n" }, { "change_type": "ADD", "old_path": null, "new_path": "model/server/.idea/vcs.xml", "diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<project version=\"4\">\n+ <component name=\"VcsDirectoryMappings\">\n+ <mapping directory=\"\" vcs=\"Git\" />\n+ </component>\n+</project>\n\\ No newline at end of file\n" }, { "change_type": "ADD", "old_path": null, "new_path": "model/server/Procfile", "diff": "+web: java -jar target/webmps-server-1.0-SNAPSHOT-jar-with-dependencies.jar\n\\ No newline at end of file\n" }, { "change_type": "ADD", "old_path": null, "new_path": "model/server/pom.xml", "diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n+ xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n+ xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n+ <modelVersion>4.0.0</modelVersion>\n+\n+ <groupId>de.q60</groupId>\n+ <artifactId>webmps-server</artifactId>\n+ <version>1.0-SNAPSHOT</version>\n+\n+ <properties>\n+ <maven.compiler.source>1.8</maven.compiler.source>\n+ <maven.compiler.target>1.8</maven.compiler.target>\n+ </properties>\n+\n+ <dependencies>\n+ <dependency>\n+ <groupId>org.json</groupId>\n+ <artifactId>json</artifactId>\n+ <version>20180813</version>\n+ </dependency>\n+ <dependency>\n+ <groupId>org.java-websocket</groupId>\n+ <artifactId>Java-WebSocket</artifactId>\n+ <version>1.4.0</version>\n+ </dependency>\n+ <dependency>\n+ <groupId>org.apache.commons</groupId>\n+ <artifactId>commons-collections4</artifactId>\n+ <version>4.4</version>\n+ </dependency>\n+ <dependency>\n+ <groupId>io.lettuce</groupId>\n+ <artifactId>lettuce-core</artifactId>\n+ <version>5.1.8.RELEASE</version>\n+ </dependency>\n+ <dependency>\n+ <groupId>log4j</groupId>\n+ <artifactId>log4j</artifactId>\n+ <version>1.2.17</version>\n+ </dependency>\n+ </dependencies>\n+\n+ <build>\n+ <plugins>\n+ <plugin>\n+ <artifactId>maven-assembly-plugin</artifactId>\n+ <configuration>\n+ <archive>\n+ <manifest>\n+ <mainClass>de.q60.webmps.server.Main</mainClass>\n+ </manifest>\n+ </archive>\n+ <descriptorRefs>\n+ <descriptorRef>jar-with-dependencies</descriptorRef>\n+ </descriptorRefs>\n+ </configuration>\n+ <executions>\n+ <execution>\n+ <id>make-assembly</id> <!-- this is used for inheritance merges -->\n+ <phase>package</phase> <!-- bind to the packaging phase -->\n+ <goals>\n+ <goal>single</goal>\n+ </goals>\n+ </execution>\n+ </executions>\n+ </plugin>\n+ </plugins>\n+ </build>\n+\n+</project>\n\\ No newline at end of file\n" }, { "change_type": "ADD", "old_path": null, "new_path": "model/server/src/main/java/de/q60/webmps/server/CachingKeyValueStore.java", "diff": "+package de.q60.webmps.server;\n+\n+/*Generated by MPS */\n+\n+import org.apache.commons.collections4.map.LRUMap;\n+\n+import java.util.Map;\n+import java.util.Objects;\n+import java.util.UUID;\n+\n+public class CachingKeyValueStore implements IKeyValueStore {\n+ private static final String NULL_STRING = UUID.randomUUID().toString();\n+\n+ private IKeyValueStore store;\n+ private Map<String, String> cache = new LRUMap<String, String>(1000);\n+\n+ public CachingKeyValueStore(IKeyValueStore store) {\n+ this.store = store;\n+ }\n+\n+ @Override\n+ public String get(String key) {\n+ if (allowCaching(key)) {\n+ String value = cache.get(key);\n+ if (value == null) {\n+ value = store.get(key);\n+ cache.put(key, value);\n+ }\n+ return (value == CachingKeyValueStore.NULL_STRING ? null : value);\n+ } else {\n+ return store.get(key);\n+ }\n+ }\n+\n+ @Override\n+ public void put(String key, String value) {\n+ if (allowCaching(key)) {\n+ String existingValue = cache.get(key);\n+ if (Objects.equals(existingValue, value)) {\n+ return;\n+ }\n+ cache.put(key, value);\n+ }\n+ store.put(key, value);\n+ }\n+\n+ @Override\n+ public void listen(final String key, final IKeyListener listener) {\n+ store.listen(key, listener);\n+ }\n+\n+ protected boolean allowCaching(String key) {\n+ return true;\n+ }\n+\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "model/server/src/main/java/de/q60/webmps/server/IKeyListener.java", "diff": "+package de.q60.webmps.server;\n+\n+/*Generated by MPS */\n+\n+\n+public interface IKeyListener {\n+ void changed(String key, String value);\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "model/server/src/main/java/de/q60/webmps/server/IKeyValueStore.java", "diff": "+package de.q60.webmps.server;\n+\n+/*Generated by MPS */\n+\n+\n+public interface IKeyValueStore {\n+ String get(String key);\n+ void put(String key, String value);\n+\n+ void listen(final String key, final IKeyListener listener);\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "model/server/src/main/java/de/q60/webmps/server/Main.java", "diff": "+package de.q60.webmps.server;\n+\n+/*Generated by MPS */\n+\n+\n+public class Main {\n+ public static void main(String[] args) {\n+ System.out.println(\"Server process started\");\n+\n+ System.out.println(\"Waiting \");\n+\n+ try {\n+ String portStr = System.getenv(\"PORT\");\n+ ModelServer server = new ModelServer(portStr == null ? 28101 : Integer.parseInt(portStr));\n+ server.start();\n+ System.out.println(\"Server started\");\n+ } catch (Exception ex) {\n+ System.out.println(\"Server failed: \" + ex.getMessage());\n+ ex.printStackTrace();\n+ }\n+ }\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "model/server/src/main/java/de/q60/webmps/server/MessageHandler.java", "diff": "+package de.q60.webmps.server;\n+\n+/*Generated by MPS */\n+\n+import org.java_websocket.WebSocket;\n+import org.json.JSONObject;\n+\n+public interface MessageHandler {\n+ void handle(WebSocket conn, JSONObject message);\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "model/server/src/main/java/de/q60/webmps/server/ModelServer.java", "diff": "+package de.q60.webmps.server;\n+\n+/*Generated by MPS */\n+\n+import org.apache.log4j.Level;\n+import org.apache.log4j.LogManager;\n+import org.apache.log4j.Logger;\n+import org.java_websocket.WebSocket;\n+import org.java_websocket.handshake.ClientHandshake;\n+import org.java_websocket.server.WebSocketServer;\n+import org.json.JSONArray;\n+import org.json.JSONObject;\n+\n+import java.io.IOException;\n+import java.net.InetSocketAddress;\n+import java.util.HashMap;\n+import java.util.HashSet;\n+import java.util.Map;\n+import java.util.Set;\n+import java.util.regex.Matcher;\n+import java.util.regex.Pattern;\n+\n+public class ModelServer extends WebSocketServer {\n+ private static final Logger LOG = LogManager.getLogger(ModelServer.class);\n+ private static final Pattern HASH_PATTERN = Pattern.compile(\"[a-zA-Z0-9\\\\-_]{43}\");\n+\n+ private MyRedisClient redisClient;\n+ private IKeyValueStore store;\n+ private Map<WebSocket, Session> sessions = new HashMap<WebSocket, Session>();\n+ private Map<String, MessageHandler> messageHandlers = new HashMap<String, MessageHandler>();\n+ private Set<String> subscribedKeys = new HashSet<String>();\n+\n+ {\n+ messageHandlers.put(\"get\", new MessageHandler() {\n+ @Override\n+ public void handle(WebSocket conn, JSONObject message) {\n+ String key = message.getString(\"key\");\n+ String value = store.get(key);\n+ JSONObject reply = new JSONObject();\n+ reply.put(\"type\", \"get\");\n+ reply.put(\"key\", key);\n+ reply.put(\"value\", value);\n+ conn.send(reply.toString());\n+ }\n+ });\n+ messageHandlers.put(\"getRecursively\", new MessageHandler() {\n+ @Override\n+ public void handle(WebSocket conn, JSONObject message) {\n+ String key = message.getString(\"key\");\n+\n+ JSONObject reply = new JSONObject();\n+ reply.put(\"type\", \"getRecursively\");\n+\n+ JSONArray entries = new JSONArray();\n+ collect(key, entries, new HashSet<>());\n+ reply.put(\"entries\", entries);\n+\n+ conn.send(reply.toString());\n+ }\n+\n+ private void collect(String key, JSONArray acc, Set<String> foundKeys) {\n+ if (foundKeys.contains(key)) return;\n+ foundKeys.add(key);\n+\n+ String value = store.get(key);\n+ JSONObject entry = new JSONObject();\n+ entry.put(\"key\", key);\n+ entry.put(\"value\", value);\n+ acc.put(entry);\n+\n+ if (value != null) {\n+ Matcher matcher = HASH_PATTERN.matcher(value);\n+ while (matcher.find()) {\n+ collect(matcher.group(), acc, foundKeys);\n+ }\n+ }\n+ }\n+ });\n+ messageHandlers.put(\"put\", new MessageHandler() {\n+ @Override\n+ public void handle(WebSocket conn, JSONObject message) {\n+ String key = message.getString(\"key\");\n+ String value = message.getString(\"value\");\n+ store.put(key, value);\n+\n+ if (subscribedKeys.contains(key)) {\n+ JSONObject notification = new JSONObject();\n+ notification.put(\"type\", \"change\");\n+ notification.put(\"key\", key);\n+ notification.put(\"value\", value);\n+ String notificationStr = notification.toString();\n+ for (Session session : sessions.values()) {\n+ if (!(session.isSubscribed(key))) {\n+ continue;\n+ }\n+ WebSocket c = session.getConnection();\n+ if (c == conn) {\n+ continue;\n+ }\n+ c.send(notificationStr);\n+ }\n+ }\n+\n+ }\n+ });\n+ messageHandlers.put(\"subscribe\", new MessageHandler() {\n+ @Override\n+ public void handle(WebSocket conn, JSONObject message) {\n+ String key = message.getString(\"key\");\n+ subscribedKeys.add(key);\n+ sessions.get(conn).subscribe(key);\n+ }\n+ });\n+ messageHandlers.put(\"flushdb\", new MessageHandler() {\n+ @Override\n+ public void handle(WebSocket conn, JSONObject message) {\n+ redisClient.flushdb();\n+ }\n+ });\n+ }\n+\n+ public ModelServer(int port) {\n+ super(new InetSocketAddress(port));\n+ redisClient = new MyRedisClient();\n+ store = new CachingKeyValueStore(redisClient);\n+ }\n+\n+ public void broadcast(String message) {\n+ for (Session session : sessions.values()) {\n+ session.getConnection().send(message);\n+ }\n+ }\n+\n+ @Override\n+ public void onOpen(WebSocket conn, ClientHandshake handshake) {\n+ sessions.put(conn, new Session(conn));\n+ }\n+\n+ @Override\n+ public void onClose(WebSocket conn, int code, String reason, boolean remote) {\n+ sessions.remove(conn).dispose();\n+ }\n+\n+ @Override\n+ public void onMessage(WebSocket conn, String message) {\n+ processMessage(conn, new JSONObject(message));\n+ }\n+\n+ @Override\n+ public void onError(WebSocket conn, Exception exception) {\n+ System.out.println(\"Error \" + exception.getMessage());\n+ exception.printStackTrace();\n+ if (LOG.isEnabledFor(Level.ERROR)) {\n+ LOG.error(\"Error \" + conn, exception);\n+ }\n+ }\n+\n+ @Override\n+ public void onStart() {\n+ }\n+\n+ @Override\n+ public void stop() {\n+ try {\n+ super.stop();\n+ for (Session session : sessions.values()) {\n+ session.dispose();\n+\n+ }\n+ redisClient.dispose();\n+ } catch (InterruptedException ex) {\n+ if (LOG.isEnabledFor(Level.ERROR)) {\n+ LOG.error(\"\", ex);\n+ }\n+ } catch (IOException ex) {\n+ if (LOG.isEnabledFor(Level.ERROR)) {\n+ LOG.error(\"\", ex);\n+ }\n+ }\n+ }\n+\n+ public void processMessage(WebSocket conn, JSONObject message) {\n+ String type = message.getString(\"type\");\n+ MessageHandler handler = messageHandlers.get(type);\n+ if (handler != null) {\n+ handler.handle(conn, message);\n+ }\n+ }\n+\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "model/server/src/main/java/de/q60/webmps/server/MyRedisClient.java", "diff": "+package de.q60.webmps.server;\n+\n+/*Generated by MPS */\n+\n+import io.lettuce.core.RedisClient;\n+import io.lettuce.core.api.StatefulRedisConnection;\n+import io.lettuce.core.api.sync.RedisCommands;\n+\n+public class MyRedisClient implements IKeyValueStore {\n+ private RedisClient redisClient;\n+ private StatefulRedisConnection<String, String> connection;\n+ private RedisCommands<String, String> syncCommands;\n+\n+ public MyRedisClient() {\n+ Thread thread = Thread.currentThread();\n+ ClassLoader prevLoader = thread.getContextClassLoader();\n+ thread.setContextClassLoader(getClass().getClassLoader());\n+ try {\n+ String redisUrl = System.getenv(\"REDIS_URL\");\n+ if (redisUrl == null || redisUrl.isEmpty()) redisUrl = \"redis://localhost:6379\";\n+ System.out.println(\"Connecting to redis using \" + redisUrl);\n+ redisClient = RedisClient.create(redisUrl);\n+ connection = redisClient.connect();\n+ syncCommands = connection.sync();\n+\n+ } finally {\n+ thread.setContextClassLoader(prevLoader);\n+ }\n+ }\n+\n+ public void dispose() {\n+ connection.close();\n+ redisClient.shutdown();\n+ }\n+\n+ @Override\n+ public String get(String key) {\n+ return syncCommands.get(key);\n+ }\n+\n+ @Override\n+ public void put(String key, String value) {\n+ syncCommands.set(key, value);\n+ }\n+\n+ @Override\n+ public void listen(final String key, final IKeyListener listener) {\n+ throw new UnsupportedOperationException();\n+ }\n+\n+ public void flushdb() {\n+ syncCommands.flushdb();\n+ }\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "model/server/src/main/java/de/q60/webmps/server/Session.java", "diff": "+package de.q60.webmps.server;\n+\n+/*Generated by MPS */\n+\n+import org.java_websocket.WebSocket;\n+\n+import java.util.HashSet;\n+import java.util.Set;\n+\n+public class Session {\n+\n+ private WebSocket connection;\n+ private Set<String> subscribedKeys = new HashSet<String>();\n+\n+ public Session(WebSocket conn) {\n+ connection = conn;\n+ }\n+\n+ public void dispose() {\n+ }\n+\n+ public WebSocket getConnection() {\n+ return this.connection;\n+ }\n+\n+ public boolean isSubscribed(String key) {\n+ return subscribedKeys.contains(key);\n+ }\n+\n+ public void subscribe(String key) {\n+ subscribedKeys.add(key);\n+ }\n+\n+ public void unsubscribe(String key) {\n+ subscribedKeys.remove(key);\n+ }\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "model/server/webmps-server.iml", "diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<module type=\"JAVA_MODULE\" version=\"4\" />\n\\ No newline at end of file\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
Copied server implementation from the 'webmps-server' repository
426,496
02.08.2019 12:16:01
-7,200
8097d69fcde0edc526e50f6c88f1720587868435
Bind to all IP addresses
[ { "change_type": "MODIFY", "old_path": "model/server/.idea/vcs.xml", "new_path": "model/server/.idea/vcs.xml", "diff": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n<component name=\"VcsDirectoryMappings\">\n- <mapping directory=\"\" vcs=\"Git\" />\n+ <mapping directory=\"$PROJECT_DIR$/../..\" vcs=\"Git\" />\n</component>\n</project>\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "model/server/src/main/java/de/q60/webmps/server/Main.java", "new_path": "model/server/src/main/java/de/q60/webmps/server/Main.java", "diff": "@@ -3,6 +3,9 @@ package de.q60.webmps.server;\n/*Generated by MPS */\n+import java.net.InetAddress;\n+import java.net.InetSocketAddress;\n+\npublic class Main {\npublic static void main(String[] args) {\nSystem.out.println(\"Server process started\");\n@@ -11,7 +14,9 @@ public class Main {\ntry {\nString portStr = System.getenv(\"PORT\");\n- ModelServer server = new ModelServer(portStr == null ? 28101 : Integer.parseInt(portStr));\n+ InetSocketAddress bindTo = new InetSocketAddress(InetAddress.getByName(\"0.0.0.0\"),\n+ portStr == null ? 28101 : Integer.parseInt(portStr));\n+ ModelServer server = new ModelServer(bindTo);\nserver.start();\nSystem.out.println(\"Server started\");\n} catch (Exception ex) {\n" }, { "change_type": "MODIFY", "old_path": "model/server/src/main/java/de/q60/webmps/server/ModelServer.java", "new_path": "model/server/src/main/java/de/q60/webmps/server/ModelServer.java", "diff": "@@ -119,8 +119,8 @@ public class ModelServer extends WebSocketServer {\n});\n}\n- public ModelServer(int port) {\n- super(new InetSocketAddress(port));\n+ public ModelServer(InetSocketAddress bindTo) {\n+ super(bindTo);\nredisClient = new MyRedisClient();\nstore = new CachingKeyValueStore(redisClient);\n}\n" }, { "change_type": "DELETE", "old_path": "model/server/webmps-server.iml", "new_path": null, "diff": "-<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n-<module type=\"JAVA_MODULE\" version=\"4\" />\n\\ No newline at end of file\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
Bind to all IP addresses
426,496
02.08.2019 14:11:40
-7,200
ff9e7c7850048bcb78b416fdc395db4dc098d8a6
Model was reverted to an earlier version in some cases
[ { "change_type": "MODIFY", "old_path": "mps/.mps/vcs.xml", "new_path": "mps/.mps/vcs.xml", "diff": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n<component name=\"VcsDirectoryMappings\">\n- <mapping directory=\"$webmps.home$\" vcs=\"Git\" />\n+ <mapping directory=\"$PROJECT_DIR$/..\" vcs=\"Git\" />\n</component>\n</project>\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "mps/de.q60.mps.web.model.mpsplugin/models/de.q60.mps.web.model.mpsplugin.mps", "new_path": "mps/de.q60.mps.web.model.mpsplugin/models/de.q60.mps.web.model.mpsplugin.mps", "diff": "</node>\n</node>\n</node>\n- <node concept=\"3clFbF\" id=\"68rqGk16ic\" role=\"3cqZAp\">\n- <node concept=\"2OqwBi\" id=\"68rqGk16id\" role=\"3clFbG\">\n- <node concept=\"37vLTw\" id=\"68rqGk16ie\" role=\"2Oq$k0\">\n+ <node concept=\"3clFbF\" id=\"68rqGk16iU\" role=\"3cqZAp\">\n+ <node concept=\"37vLTI\" id=\"68rqGk16iV\" role=\"3clFbG\">\n+ <node concept=\"2ShNRf\" id=\"68rqGk16iW\" role=\"37vLTx\">\n+ <node concept=\"YeOm9\" id=\"2aF4Yjs1X7j\" role=\"2ShVmc\">\n+ <node concept=\"1Y3b0j\" id=\"2aF4Yjs1X7m\" role=\"YeSDq\">\n+ <property role=\"2bfB8j\" value=\"true\" />\n+ <ref role=\"37wK5l\" node=\"2QcRnT1GLkd\" resolve=\"BranchSynchronizer\" />\n+ <ref role=\"1Y3XeK\" node=\"2QcRnT1GIIP\" resolve=\"BranchSynchronizer\" />\n+ <node concept=\"3Tm1VV\" id=\"2aF4Yjs1X7n\" role=\"1B3o_S\" />\n+ <node concept=\"37vLTw\" id=\"68rqGk16iY\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"68rqGk16i1\" resolve=\"clientBranch\" />\n+ </node>\n+ <node concept=\"37vLTw\" id=\"68rqGk16iZ\" role=\"37wK5m\">\n<ref role=\"3cqZAo\" node=\"68rqGk16i7\" resolve=\"serverBranch\" />\n</node>\n- <node concept=\"liA8E\" id=\"68rqGk16if\" role=\"2OqNvi\">\n- <ref role=\"37wK5l\" to=\"3hky:5QP6xyjMcer\" resolve=\"addListener\" />\n- <node concept=\"2ShNRf\" id=\"68rqGk16ig\" role=\"37wK5m\">\n- <node concept=\"YeOm9\" id=\"68rqGk16ih\" role=\"2ShVmc\">\n- <node concept=\"1Y3b0j\" id=\"68rqGk16ii\" role=\"YeSDq\">\n- <property role=\"2bfB8j\" value=\"true\" />\n- <ref role=\"1Y3XeK\" to=\"3hky:5QP6xyjMbUr\" resolve=\"IBranchListener\" />\n- <ref role=\"37wK5l\" to=\"wyt6:~Object.&lt;init&gt;()\" resolve=\"Object\" />\n- <node concept=\"3Tm1VV\" id=\"68rqGk16ij\" role=\"1B3o_S\" />\n- <node concept=\"3clFb_\" id=\"68rqGk16ik\" role=\"jymVt\">\n- <property role=\"TrG5h\" value=\"treeChanged\" />\n- <node concept=\"37vLTG\" id=\"68rqGk16il\" role=\"3clF46\">\n- <property role=\"TrG5h\" value=\"oldTree\" />\n- <node concept=\"3uibUv\" id=\"68rqGk16im\" role=\"1tU5fm\">\n- <ref role=\"3uigEE\" to=\"3hky:4_SQzDOqQ5x\" resolve=\"ITree\" />\n+ <node concept=\"37vLTw\" id=\"68rqGk16j0\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"68rqGk16hp\" resolve=\"repo\" />\n+ </node>\n+ <node concept=\"3clFb_\" id=\"2aF4Yjs1Y2p\" role=\"jymVt\">\n+ <property role=\"TrG5h\" value=\"write\" />\n+ <node concept=\"37vLTG\" id=\"2aF4Yjs1Y2q\" role=\"3clF46\">\n+ <property role=\"TrG5h\" value=\"branch\" />\n+ <property role=\"3TUv4t\" value=\"true\" />\n+ <node concept=\"3uibUv\" id=\"2aF4Yjs1Y2r\" role=\"1tU5fm\">\n+ <ref role=\"3uigEE\" to=\"3hky:4_SQzDO0jT3\" resolve=\"IBranch\" />\n</node>\n</node>\n- <node concept=\"37vLTG\" id=\"68rqGk16in\" role=\"3clF46\">\n+ <node concept=\"37vLTG\" id=\"2aF4Yjs1Y2s\" role=\"3clF46\">\n<property role=\"TrG5h\" value=\"newTree\" />\n- <node concept=\"3uibUv\" id=\"68rqGk16io\" role=\"1tU5fm\">\n+ <property role=\"3TUv4t\" value=\"true\" />\n+ <node concept=\"3uibUv\" id=\"2aF4Yjs1Y2t\" role=\"1tU5fm\">\n<ref role=\"3uigEE\" to=\"3hky:4_SQzDOqQ5x\" resolve=\"ITree\" />\n</node>\n</node>\n- <node concept=\"3cqZAl\" id=\"68rqGk16ip\" role=\"3clF45\" />\n- <node concept=\"3Tm1VV\" id=\"68rqGk16iq\" role=\"1B3o_S\" />\n- <node concept=\"3clFbS\" id=\"68rqGk16ir\" role=\"3clF47\">\n+ <node concept=\"3cqZAl\" id=\"2aF4Yjs1Y2u\" role=\"3clF45\" />\n+ <node concept=\"3Tmbuc\" id=\"2aF4Yjs1Y2v\" role=\"1B3o_S\" />\n+ <node concept=\"3clFbS\" id=\"2aF4Yjs1Y2N\" role=\"3clF47\">\n+ <node concept=\"3clFbF\" id=\"2aF4Yjs1Y2S\" role=\"3cqZAp\">\n+ <node concept=\"3nyPlj\" id=\"2aF4Yjs1Y2R\" role=\"3clFbG\">\n+ <ref role=\"37wK5l\" node=\"2QcRnT1I7cl\" resolve=\"write\" />\n+ <node concept=\"37vLTw\" id=\"2aF4Yjs1Y2P\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"2aF4Yjs1Y2q\" resolve=\"branch\" />\n+ </node>\n+ <node concept=\"37vLTw\" id=\"2aF4Yjs1Y2Q\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"2aF4Yjs1Y2s\" resolve=\"newTree\" />\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3clFbJ\" id=\"2aF4Yjs2eVs\" role=\"3cqZAp\">\n+ <node concept=\"3clFbS\" id=\"2aF4Yjs2eVu\" role=\"3clFbx\">\n<node concept=\"3cpWs8\" id=\"68rqGk16is\" role=\"3cqZAp\">\n<node concept=\"3cpWsn\" id=\"68rqGk16it\" role=\"3cpWs9\">\n<property role=\"TrG5h\" value=\"tree\" />\n<ref role=\"3uigEE\" to=\"jon5:1SVbIFIiXt2\" resolve=\"CLTree\" />\n</node>\n<node concept=\"37vLTw\" id=\"68rqGk16iy\" role=\"10QFUP\">\n- <ref role=\"3cqZAo\" node=\"68rqGk16in\" resolve=\"newTree\" />\n+ <ref role=\"3cqZAo\" node=\"2aF4Yjs1Y2s\" resolve=\"newTree\" />\n</node>\n</node>\n</node>\n<node concept=\"17QB3L\" id=\"68rqGk4TVk\" role=\"1tU5fm\" />\n<node concept=\"2OqwBi\" id=\"68rqGk5zY$\" role=\"33vP2m\">\n<node concept=\"2YIFZM\" id=\"68rqGk5yqI\" role=\"2Oq$k0\">\n- <ref role=\"37wK5l\" to=\"28m1:~LocalDateTime.now()\" resolve=\"now\" />\n<ref role=\"1Pybhc\" to=\"28m1:~LocalDateTime\" resolve=\"LocalDateTime\" />\n+ <ref role=\"37wK5l\" to=\"28m1:~LocalDateTime.now()\" resolve=\"now\" />\n</node>\n<node concept=\"liA8E\" id=\"68rqGk5Ae_\" role=\"2OqNvi\">\n<ref role=\"37wK5l\" to=\"28m1:~LocalDateTime.toString()\" resolve=\"toString\" />\n</node>\n</node>\n</node>\n- <node concept=\"2AHcQZ\" id=\"68rqGk16iT\" role=\"2AJF6D\">\n- <ref role=\"2AI5Lk\" to=\"wyt6:~Override\" resolve=\"Override\" />\n- </node>\n- </node>\n- </node>\n+ <node concept=\"3clFbC\" id=\"2aF4Yjs2f_M\" role=\"3clFbw\">\n+ <node concept=\"37vLTw\" id=\"2aF4Yjs2gI_\" role=\"3uHU7w\">\n+ <ref role=\"3cqZAo\" node=\"68rqGk16i7\" resolve=\"serverBranch\" />\n</node>\n+ <node concept=\"37vLTw\" id=\"2aF4Yjs2fuG\" role=\"3uHU7B\">\n+ <ref role=\"3cqZAo\" node=\"2aF4Yjs1Y2q\" resolve=\"branch\" />\n</node>\n</node>\n</node>\n</node>\n- <node concept=\"3clFbF\" id=\"68rqGk16iU\" role=\"3cqZAp\">\n- <node concept=\"37vLTI\" id=\"68rqGk16iV\" role=\"3clFbG\">\n- <node concept=\"2ShNRf\" id=\"68rqGk16iW\" role=\"37vLTx\">\n- <node concept=\"1pGfFk\" id=\"68rqGk16iX\" role=\"2ShVmc\">\n- <ref role=\"37wK5l\" node=\"2QcRnT1GLkd\" resolve=\"BranchSynchronizer\" />\n- <node concept=\"37vLTw\" id=\"68rqGk16iY\" role=\"37wK5m\">\n- <ref role=\"3cqZAo\" node=\"68rqGk16i1\" resolve=\"clientBranch\" />\n+ <node concept=\"2AHcQZ\" id=\"2aF4Yjs1Y2O\" role=\"2AJF6D\">\n+ <ref role=\"2AI5Lk\" to=\"wyt6:~Override\" resolve=\"Override\" />\n</node>\n- <node concept=\"37vLTw\" id=\"68rqGk16iZ\" role=\"37wK5m\">\n- <ref role=\"3cqZAo\" node=\"68rqGk16i7\" resolve=\"serverBranch\" />\n</node>\n- <node concept=\"37vLTw\" id=\"68rqGk16j0\" role=\"37wK5m\">\n- <ref role=\"3cqZAo\" node=\"68rqGk16hp\" resolve=\"repo\" />\n</node>\n</node>\n</node>\n</node>\n</node>\n</node>\n- <node concept=\"3cpWs6\" id=\"SFiDn0m6qD\" role=\"3cqZAp\">\n+ <node concept=\"3cpWs6\" id=\"7gF2HTvnR2f\" role=\"3cqZAp\">\n+ <node concept=\"2ShNRf\" id=\"7gF2HTvnR2g\" role=\"3cqZAk\">\n+ <node concept=\"1pGfFk\" id=\"7gF2HTvnR2h\" role=\"2ShVmc\">\n+ <ref role=\"37wK5l\" to=\"zf81:~URI.&lt;init&gt;(java.lang.String)\" resolve=\"URI\" />\n+ <node concept=\"Xl_RD\" id=\"7gF2HTvnR2i\" role=\"37wK5m\">\n+ <property role=\"Xl_RC\" value=\"ws://webmps2.q60.de:80\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"1X3_iC\" id=\"7gF2HTvnRn$\" role=\"lGtFl\">\n+ <property role=\"3V$3am\" value=\"statement\" />\n+ <property role=\"3V$3ak\" value=\"f3061a53-9226-4cc5-a443-f952ceaf5816/1068580123136/1068581517665\" />\n+ <node concept=\"3cpWs6\" id=\"SFiDn0m6qD\" role=\"8Wnug\">\n<node concept=\"2ShNRf\" id=\"SFiDn0m6qE\" role=\"3cqZAk\">\n<node concept=\"1pGfFk\" id=\"SFiDn0m6qF\" role=\"2ShVmc\">\n<ref role=\"37wK5l\" to=\"zf81:~URI.&lt;init&gt;(java.lang.String)\" resolve=\"URI\" />\n</node>\n</node>\n</node>\n+ </node>\n<node concept=\"TDmWw\" id=\"5nE7Pe9bR2j\" role=\"TEbGg\">\n<node concept=\"3cpWsn\" id=\"5nE7Pe9bR2k\" role=\"TDEfY\">\n<property role=\"TrG5h\" value=\"ex\" />\n<node concept=\"3cpWsb\" id=\"gibv3c01s1\" role=\"1tU5fm\" />\n<node concept=\"3Tm6S6\" id=\"gibv3bZZPj\" role=\"1B3o_S\" />\n<node concept=\"1adDum\" id=\"gibv3c01Kh\" role=\"33vP2m\">\n- <property role=\"1adDun\" value=\"30000L\" />\n+ <property role=\"1adDun\" value=\"5000L\" />\n</node>\n</node>\n<node concept=\"312cEg\" id=\"gibv3bZCNe\" role=\"jymVt\">\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
Model was reverted to an earlier version in some cases
426,496
06.08.2019 22:38:42
-7,200
a7987183fff73c3909efeedb5ad6f084d414aafc
Debug output on the server
[ { "change_type": "MODIFY", "old_path": "model/server/src/main/java/de/q60/webmps/server/ModelServer.java", "new_path": "model/server/src/main/java/de/q60/webmps/server/ModelServer.java", "diff": "@@ -40,7 +40,7 @@ public class ModelServer extends WebSocketServer {\nreply.put(\"type\", \"get\");\nreply.put(\"key\", key);\nreply.put(\"value\", value);\n- conn.send(reply.toString());\n+ send(conn, reply.toString());\n}\n});\nmessageHandlers.put(\"getRecursively\", new MessageHandler() {\n@@ -55,7 +55,7 @@ public class ModelServer extends WebSocketServer {\ncollect(key, entries, new HashSet<>());\nreply.put(\"entries\", entries);\n- conn.send(reply.toString());\n+ send(conn, reply.toString());\n}\nprivate void collect(String key, JSONArray acc, Set<String> foundKeys) {\n@@ -97,7 +97,7 @@ public class ModelServer extends WebSocketServer {\nif (c == conn) {\ncontinue;\n}\n- c.send(notificationStr);\n+ send(c, notificationStr);\n}\n}\n@@ -127,7 +127,7 @@ public class ModelServer extends WebSocketServer {\npublic void broadcast(String message) {\nfor (Session session : sessions.values()) {\n- session.getConnection().send(message);\n+ send(session.getConnection(), message);\n}\n}\n@@ -143,9 +143,15 @@ public class ModelServer extends WebSocketServer {\n@Override\npublic void onMessage(WebSocket conn, String message) {\n+ System.out.println(sessions.get(conn).getId() + \" R \" + message);\nprocessMessage(conn, new JSONObject(message));\n}\n+ private void send(WebSocket conn, String message) {\n+ System.out.println(sessions.get(conn).getId() + \" S \" + message);\n+ conn.send(message);\n+ }\n+\n@Override\npublic void onError(WebSocket conn, Exception exception) {\nSystem.out.println(\"Error \" + exception.getMessage());\n" }, { "change_type": "MODIFY", "old_path": "model/server/src/main/java/de/q60/webmps/server/Session.java", "new_path": "model/server/src/main/java/de/q60/webmps/server/Session.java", "diff": "@@ -6,9 +6,12 @@ import org.java_websocket.WebSocket;\nimport java.util.HashSet;\nimport java.util.Set;\n+import java.util.concurrent.atomic.AtomicLong;\npublic class Session {\n+ private static final AtomicLong ID_SEQUENCE = new AtomicLong();\n+ private long id = ID_SEQUENCE.incrementAndGet();\nprivate WebSocket connection;\nprivate Set<String> subscribedKeys = new HashSet<String>();\n@@ -34,4 +37,8 @@ public class Session {\npublic void unsubscribe(String key) {\nsubscribedKeys.remove(key);\n}\n+\n+ public long getId() {\n+ return id;\n+ }\n}\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
Debug output on the server
426,496
07.08.2019 16:02:18
-7,200
1d1cba21de0d555287ee59d229e27851898c3e19
OT: When merging two versions some operations were transformed against the wrong operations
[ { "change_type": "MODIFY", "old_path": "mps/de.q60.mps.web.model.mpsplugin/models/de.q60.mps.web.model.mpsplugin.history.mps", "new_path": "mps/de.q60.mps.web.model.mpsplugin/models/de.q60.mps.web.model.mpsplugin.history.mps", "diff": "</node>\n</node>\n</node>\n+ <node concept=\"3clFbH\" id=\"5oJTJC8a1Ff\" role=\"3cqZAp\" />\n+ <node concept=\"3cpWs8\" id=\"5oJTJC8a1F9\" role=\"3cqZAp\">\n+ <node concept=\"3cpWsn\" id=\"5oJTJC8a1Fa\" role=\"3cpWs9\">\n+ <property role=\"TrG5h\" value=\"mergeButton\" />\n+ <node concept=\"3uibUv\" id=\"5oJTJC8a1Fb\" role=\"1tU5fm\">\n+ <ref role=\"3uigEE\" to=\"dxuu:~JButton\" resolve=\"JButton\" />\n+ </node>\n+ <node concept=\"2ShNRf\" id=\"5oJTJC8a1Fc\" role=\"33vP2m\">\n+ <node concept=\"1pGfFk\" id=\"5oJTJC8a1Fd\" role=\"2ShVmc\">\n+ <ref role=\"37wK5l\" to=\"dxuu:~JButton.&lt;init&gt;(java.lang.String)\" resolve=\"JButton\" />\n+ <node concept=\"Xl_RD\" id=\"5oJTJC8a1Fe\" role=\"37wK5m\">\n+ <property role=\"Xl_RC\" value=\"Merge remote version\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3clFbF\" id=\"5oJTJC8a1F4\" role=\"3cqZAp\">\n+ <node concept=\"2OqwBi\" id=\"5oJTJC8a1F5\" role=\"3clFbG\">\n+ <node concept=\"37vLTw\" id=\"5oJTJC8a1F6\" role=\"2Oq$k0\">\n+ <ref role=\"3cqZAo\" node=\"2D0HTQhaDde\" resolve=\"buttons\" />\n+ </node>\n+ <node concept=\"liA8E\" id=\"5oJTJC8a1F7\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" to=\"z60i:~Container.add(java.awt.Component)\" resolve=\"add\" />\n+ <node concept=\"37vLTw\" id=\"5oJTJC8arlG\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"5oJTJC8a1Fa\" resolve=\"mergeButton\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3clFbF\" id=\"5oJTJC8a1EU\" role=\"3cqZAp\">\n+ <node concept=\"2OqwBi\" id=\"5oJTJC8a1EV\" role=\"3clFbG\">\n+ <node concept=\"37vLTw\" id=\"5oJTJC8a3$C\" role=\"2Oq$k0\">\n+ <ref role=\"3cqZAo\" node=\"5oJTJC8a1Fa\" resolve=\"mergeButton\" />\n+ </node>\n+ <node concept=\"liA8E\" id=\"5oJTJC8a1EX\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" to=\"dxuu:~AbstractButton.addActionListener(java.awt.event.ActionListener)\" resolve=\"addActionListener\" />\n+ <node concept=\"1bVj0M\" id=\"5oJTJC8a1EY\" role=\"37wK5m\">\n+ <node concept=\"37vLTG\" id=\"5oJTJC8a1EZ\" role=\"1bW2Oz\">\n+ <property role=\"TrG5h\" value=\"e\" />\n+ <node concept=\"3uibUv\" id=\"5oJTJC8a1F0\" role=\"1tU5fm\">\n+ <ref role=\"3uigEE\" to=\"hyam:~ActionEvent\" resolve=\"ActionEvent\" />\n+ </node>\n+ </node>\n+ <node concept=\"3clFbS\" id=\"5oJTJC8a1F1\" role=\"1bW5cS\">\n+ <node concept=\"3clFbF\" id=\"5oJTJC8a1F2\" role=\"3cqZAp\">\n+ <node concept=\"2OqwBi\" id=\"5oJTJC8a3L6\" role=\"3clFbG\">\n+ <node concept=\"2YIFZM\" id=\"5oJTJC8a3L7\" role=\"2Oq$k0\">\n+ <ref role=\"1Pybhc\" to=\"csg2:68rqGk1601\" resolve=\"CollaborativeEditing\" />\n+ <ref role=\"37wK5l\" to=\"csg2:2D0HTQhbLCs\" resolve=\"getInstance\" />\n+ </node>\n+ <node concept=\"liA8E\" id=\"5oJTJC8a43B\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" to=\"csg2:5oJTJC89M6r\" resolve=\"processPendingRemoteVersion\" />\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3clFbF\" id=\"5oJTJC8auYd\" role=\"3cqZAp\">\n+ <node concept=\"1rXfSq\" id=\"5oJTJC8auYb\" role=\"3clFbG\">\n+ <ref role=\"37wK5l\" node=\"2D0HTQh9kjZ\" resolve=\"loadHistory\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n</node>\n</node>\n<node concept=\"2tJIrI\" id=\"2D0HTQh9kdl\" role=\"jymVt\" />\n" }, { "change_type": "MODIFY", "old_path": "mps/de.q60.mps.web.model.mpsplugin/models/de.q60.mps.web.model.mpsplugin.mps", "new_path": "mps/de.q60.mps.web.model.mpsplugin/models/de.q60.mps.web.model.mpsplugin.mps", "diff": "<concept id=\"4611582986551314327\" name=\"jetbrains.mps.baseLanguage.collections.structure.OfTypeOperation\" flags=\"nn\" index=\"UnYns\">\n<child id=\"4611582986551314344\" name=\"requestedType\" index=\"UnYnz\" />\n</concept>\n- <concept id=\"1160666733551\" name=\"jetbrains.mps.baseLanguage.collections.structure.AddAllElementsOperation\" flags=\"nn\" index=\"X8dFx\" />\n<concept id=\"1240151247486\" name=\"jetbrains.mps.baseLanguage.collections.structure.ContainerIteratorType\" flags=\"in\" index=\"2YL$Hu\" />\n<concept id=\"1240151544672\" name=\"jetbrains.mps.baseLanguage.collections.structure.RemoveOperation\" flags=\"nn\" index=\"2YMH90\" />\n<concept id=\"1240217271293\" name=\"jetbrains.mps.baseLanguage.collections.structure.LinkedHashSetCreator\" flags=\"nn\" index=\"32HrFt\" />\n<ref role=\"3uigEE\" to=\"jon5:2D0HTQhahjL\" resolve=\"CLVersion\" />\n</node>\n</node>\n- <node concept=\"2tJIrI\" id=\"51I69MoqPce\" role=\"jymVt\" />\n+ <node concept=\"312cEg\" id=\"5oJTJC89Cg9\" role=\"jymVt\">\n+ <property role=\"TrG5h\" value=\"pendingRemoteVersion\" />\n+ <node concept=\"3Tm6S6\" id=\"5oJTJC89Cga\" role=\"1B3o_S\" />\n+ <node concept=\"17QB3L\" id=\"5oJTJC89EEx\" role=\"1tU5fm\" />\n+ </node>\n+ <node concept=\"2tJIrI\" id=\"5oJTJC89_PT\" role=\"jymVt\" />\n<node concept=\"312cEg\" id=\"51I69MoqMU8\" role=\"jymVt\">\n<property role=\"TrG5h\" value=\"commandListener\" />\n<node concept=\"3Tm6S6\" id=\"51I69MoqMU9\" role=\"1B3o_S\" />\n</node>\n</node>\n</node>\n- <node concept=\"3cpWs8\" id=\"LXqpnu0i1I\" role=\"3cqZAp\">\n- <node concept=\"3cpWsn\" id=\"LXqpnu0i1J\" role=\"3cpWs9\">\n- <property role=\"TrG5h\" value=\"version\" />\n- <node concept=\"3uibUv\" id=\"LXqpnu0i1K\" role=\"1tU5fm\">\n- <ref role=\"3uigEE\" to=\"jon5:2D0HTQhahjL\" resolve=\"CLVersion\" />\n- </node>\n- <node concept=\"2ShNRf\" id=\"LXqpnu0jly\" role=\"33vP2m\">\n- <node concept=\"1pGfFk\" id=\"LXqpnu0lHP\" role=\"2ShVmc\">\n- <ref role=\"37wK5l\" to=\"jon5:LXqpntXtg5\" resolve=\"CLVersion\" />\n- <node concept=\"37vLTw\" id=\"LXqpnu0mQ7\" role=\"37wK5m\">\n+ <node concept=\"3clFbF\" id=\"5oJTJC89Gef\" role=\"3cqZAp\">\n+ <node concept=\"37vLTI\" id=\"5oJTJC89Hcr\" role=\"3clFbG\">\n+ <node concept=\"37vLTw\" id=\"5oJTJC89Irr\" role=\"37vLTx\">\n<ref role=\"3cqZAo\" node=\"74SroTqJocq\" resolve=\"versionHash\" />\n</node>\n- <node concept=\"37vLTw\" id=\"LXqpnu0o65\" role=\"37wK5m\">\n- <ref role=\"3cqZAo\" node=\"74SroTqJSIW\" resolve=\"storeCache\" />\n- </node>\n- </node>\n- </node>\n- </node>\n- </node>\n- <node concept=\"3clFbF\" id=\"51I69Mov$Kk\" role=\"3cqZAp\">\n- <node concept=\"37vLTI\" id=\"51I69Mov$Km\" role=\"3clFbG\">\n- <node concept=\"2OqwBi\" id=\"51I69Mov$tk\" role=\"37vLTx\">\n- <node concept=\"37vLTw\" id=\"51I69Mov$tl\" role=\"2Oq$k0\">\n- <ref role=\"3cqZAo\" node=\"51I69MoppK7\" resolve=\"merger\" />\n- </node>\n- <node concept=\"liA8E\" id=\"51I69Mov$tm\" role=\"2OqNvi\">\n- <ref role=\"37wK5l\" node=\"51I69Mo9$19\" resolve=\"mergeChange\" />\n- <node concept=\"37vLTw\" id=\"51I69MovAwl\" role=\"37wK5m\">\n- <ref role=\"3cqZAo\" node=\"LXqpnu0i1J\" resolve=\"version\" />\n- </node>\n- </node>\n- </node>\n- <node concept=\"37vLTw\" id=\"51I69Mov_F_\" role=\"37vLTJ\">\n- <ref role=\"3cqZAo\" node=\"LXqpnu0i1J\" resolve=\"version\" />\n- </node>\n- </node>\n- </node>\n- <node concept=\"3clFbF\" id=\"LXqpnu0Gq2\" role=\"3cqZAp\">\n- <node concept=\"1rXfSq\" id=\"LXqpnu0Gq0\" role=\"3clFbG\">\n- <ref role=\"37wK5l\" node=\"LXqpntYm5j\" resolve=\"loadVersion\" />\n- <node concept=\"37vLTw\" id=\"LXqpnu0MqD\" role=\"37wK5m\">\n- <ref role=\"3cqZAo\" node=\"LXqpnu0i1J\" resolve=\"version\" />\n+ <node concept=\"37vLTw\" id=\"5oJTJC89Ged\" role=\"37vLTJ\">\n+ <ref role=\"3cqZAo\" node=\"5oJTJC89Cg9\" resolve=\"pendingRemoteVersion\" />\n</node>\n</node>\n</node>\n</node>\n</node>\n<node concept=\"2tJIrI\" id=\"74SroTqJscS\" role=\"jymVt\" />\n+ <node concept=\"3clFb_\" id=\"5oJTJC89M6r\" role=\"jymVt\">\n+ <property role=\"TrG5h\" value=\"processPendingRemoteVersion\" />\n+ <node concept=\"3cqZAl\" id=\"5oJTJC89M6t\" role=\"3clF45\" />\n+ <node concept=\"3Tm1VV\" id=\"5oJTJC89M6u\" role=\"1B3o_S\" />\n+ <node concept=\"3clFbS\" id=\"5oJTJC89M6v\" role=\"3clF47\">\n+ <node concept=\"3clFbJ\" id=\"5oJTJC89ZnM\" role=\"3cqZAp\">\n+ <node concept=\"3clFbS\" id=\"5oJTJC89ZnO\" role=\"3clFbx\">\n+ <node concept=\"3clFbF\" id=\"5oJTJC89YEN\" role=\"3cqZAp\">\n+ <node concept=\"1rXfSq\" id=\"5oJTJC89YEM\" role=\"3clFbG\">\n+ <ref role=\"37wK5l\" node=\"5oJTJC89qEE\" resolve=\"mergeVersion\" />\n+ <node concept=\"37vLTw\" id=\"5oJTJC89Z6$\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"5oJTJC89Cg9\" resolve=\"pendingRemoteVersion\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3y3z36\" id=\"5oJTJC8a0lz\" role=\"3clFbw\">\n+ <node concept=\"10Nm6u\" id=\"5oJTJC8a0yJ\" role=\"3uHU7w\" />\n+ <node concept=\"37vLTw\" id=\"5oJTJC89ZKj\" role=\"3uHU7B\">\n+ <ref role=\"3cqZAo\" node=\"5oJTJC89Cg9\" resolve=\"pendingRemoteVersion\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"2tJIrI\" id=\"5oJTJC89JGW\" role=\"jymVt\" />\n+ <node concept=\"3clFb_\" id=\"5oJTJC89qEE\" role=\"jymVt\">\n+ <property role=\"TrG5h\" value=\"mergeVersion\" />\n+ <node concept=\"37vLTG\" id=\"5oJTJC89wLR\" role=\"3clF46\">\n+ <property role=\"TrG5h\" value=\"versionHash\" />\n+ <node concept=\"17QB3L\" id=\"5oJTJC89wLS\" role=\"1tU5fm\" />\n+ </node>\n+ <node concept=\"3cqZAl\" id=\"5oJTJC89qEG\" role=\"3clF45\" />\n+ <node concept=\"3Tm1VV\" id=\"5oJTJC89qEH\" role=\"1B3o_S\" />\n+ <node concept=\"3clFbS\" id=\"5oJTJC89qEI\" role=\"3clF47\">\n+ <node concept=\"3clFbJ\" id=\"5oJTJC89wxe\" role=\"3cqZAp\">\n+ <node concept=\"3clFbS\" id=\"5oJTJC89wxf\" role=\"3clFbx\">\n+ <node concept=\"3cpWs6\" id=\"5oJTJC89wxg\" role=\"3cqZAp\" />\n+ </node>\n+ <node concept=\"17R0WA\" id=\"5oJTJC89wxh\" role=\"3clFbw\">\n+ <node concept=\"37vLTw\" id=\"5oJTJC89wxi\" role=\"3uHU7w\">\n+ <ref role=\"3cqZAo\" node=\"5oJTJC89wLR\" resolve=\"versionHash\" />\n+ </node>\n+ <node concept=\"2EnYce\" id=\"5oJTJC89wxj\" role=\"3uHU7B\">\n+ <node concept=\"37vLTw\" id=\"5oJTJC89wxk\" role=\"2Oq$k0\">\n+ <ref role=\"3cqZAo\" node=\"51I69MosmzI\" resolve=\"loadedVersion\" />\n+ </node>\n+ <node concept=\"liA8E\" id=\"5oJTJC89wxl\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" to=\"jon5:2D0HTQhaui_\" resolve=\"getHash\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3cpWs8\" id=\"5oJTJC89wxm\" role=\"3cqZAp\">\n+ <node concept=\"3cpWsn\" id=\"5oJTJC89wxn\" role=\"3cpWs9\">\n+ <property role=\"TrG5h\" value=\"version\" />\n+ <node concept=\"3uibUv\" id=\"5oJTJC89wxo\" role=\"1tU5fm\">\n+ <ref role=\"3uigEE\" to=\"jon5:2D0HTQhahjL\" resolve=\"CLVersion\" />\n+ </node>\n+ <node concept=\"2ShNRf\" id=\"5oJTJC89wxp\" role=\"33vP2m\">\n+ <node concept=\"1pGfFk\" id=\"5oJTJC89wxq\" role=\"2ShVmc\">\n+ <ref role=\"37wK5l\" to=\"jon5:LXqpntXtg5\" resolve=\"CLVersion\" />\n+ <node concept=\"37vLTw\" id=\"5oJTJC89wxr\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"5oJTJC89wLR\" resolve=\"versionHash\" />\n+ </node>\n+ <node concept=\"37vLTw\" id=\"5oJTJC89wxs\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"74SroTqJSIW\" resolve=\"storeCache\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3clFbF\" id=\"5oJTJC89wxt\" role=\"3cqZAp\">\n+ <node concept=\"37vLTI\" id=\"5oJTJC89wxu\" role=\"3clFbG\">\n+ <node concept=\"2OqwBi\" id=\"5oJTJC89wxv\" role=\"37vLTx\">\n+ <node concept=\"37vLTw\" id=\"5oJTJC89wxw\" role=\"2Oq$k0\">\n+ <ref role=\"3cqZAo\" node=\"51I69MoppK7\" resolve=\"merger\" />\n+ </node>\n+ <node concept=\"liA8E\" id=\"5oJTJC89wxx\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" node=\"51I69Mo9$19\" resolve=\"mergeChange\" />\n+ <node concept=\"37vLTw\" id=\"5oJTJC89wxy\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"5oJTJC89wxn\" resolve=\"version\" />\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"37vLTw\" id=\"5oJTJC89wxz\" role=\"37vLTJ\">\n+ <ref role=\"3cqZAo\" node=\"5oJTJC89wxn\" resolve=\"version\" />\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3clFbF\" id=\"5oJTJC89wx$\" role=\"3cqZAp\">\n+ <node concept=\"1rXfSq\" id=\"5oJTJC89wx_\" role=\"3clFbG\">\n+ <ref role=\"37wK5l\" node=\"LXqpntYm5j\" resolve=\"loadVersion\" />\n+ <node concept=\"37vLTw\" id=\"5oJTJC89wxA\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"5oJTJC89wxn\" resolve=\"version\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"2tJIrI\" id=\"5oJTJC89oj_\" role=\"jymVt\" />\n<node concept=\"3clFb_\" id=\"2D0HTQhbS9W\" role=\"jymVt\">\n<property role=\"TrG5h\" value=\"getVersion\" />\n<node concept=\"3uibUv\" id=\"2D0HTQhc21O\" role=\"3clF45\">\n</node>\n</node>\n</node>\n+ <node concept=\"3clFbF\" id=\"4XkngwenYvW\" role=\"3cqZAp\">\n+ <node concept=\"37vLTI\" id=\"4XkngwenYQp\" role=\"3clFbG\">\n+ <node concept=\"2ShNRf\" id=\"4XkngwenZqs\" role=\"37vLTx\">\n+ <node concept=\"1pGfFk\" id=\"4XkngwenZ3d\" role=\"2ShVmc\">\n+ <ref role=\"37wK5l\" node=\"51I69Mopel7\" resolve=\"VersionMerger\" />\n+ <node concept=\"37vLTw\" id=\"4Xkngweo0l1\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"74SroTqJSIW\" resolve=\"storeCache\" />\n+ </node>\n+ <node concept=\"37vLTw\" id=\"4Xkngweo0Sv\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"51I69MopwlN\" resolve=\"idGenerator\" />\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"37vLTw\" id=\"4XkngwenYvU\" role=\"37vLTJ\">\n+ <ref role=\"3cqZAo\" node=\"51I69MoppK7\" resolve=\"merger\" />\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3clFbF\" id=\"4Xkngweo1iJ\" role=\"3cqZAp\">\n+ <node concept=\"2OqwBi\" id=\"4Xkngweo1CW\" role=\"3clFbG\">\n+ <node concept=\"37vLTw\" id=\"4Xkngweo1iH\" role=\"2Oq$k0\">\n+ <ref role=\"3cqZAo\" node=\"51I69MoppK7\" resolve=\"merger\" />\n+ </node>\n+ <node concept=\"liA8E\" id=\"4Xkngweo1Nw\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" node=\"51I69Mo9$19\" resolve=\"mergeChange\" />\n+ <node concept=\"37vLTw\" id=\"4Xkngweo21$\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"LXqpntYsK8\" resolve=\"version\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n</node>\n</node>\n<node concept=\"2tJIrI\" id=\"LXqpntYjxy\" role=\"jymVt\" />\n</node>\n</node>\n<node concept=\"3clFbH\" id=\"51I69Mocstl\" role=\"3cqZAp\" />\n- <node concept=\"3cpWs8\" id=\"51I69MocsI2\" role=\"3cqZAp\">\n- <node concept=\"3cpWsn\" id=\"51I69MocsI5\" role=\"3cpWs9\">\n- <property role=\"TrG5h\" value=\"wasLeft\" />\n- <node concept=\"10P_77\" id=\"51I69MocsI0\" role=\"1tU5fm\" />\n- <node concept=\"3clFbT\" id=\"51I69Moctel\" role=\"33vP2m\">\n- <property role=\"3clFbU\" value=\"true\" />\n+ <node concept=\"3cpWs8\" id=\"63wwZGi_pXr\" role=\"3cqZAp\">\n+ <node concept=\"3cpWsn\" id=\"63wwZGi_pXs\" role=\"3cpWs9\">\n+ <property role=\"TrG5h\" value=\"leftAppliedOps\" />\n+ <node concept=\"_YKpA\" id=\"63wwZGi_pXt\" role=\"1tU5fm\">\n+ <node concept=\"3uibUv\" id=\"63wwZGi_LBw\" role=\"_ZDj9\">\n+ <ref role=\"3uigEE\" to=\"ydze:1U0efzLyBFX\" resolve=\"IAppliedOperation\" />\n</node>\n</node>\n+ <node concept=\"2ShNRf\" id=\"63wwZGi_pXv\" role=\"33vP2m\">\n+ <node concept=\"Tc6Ow\" id=\"63wwZGi_pXw\" role=\"2ShVmc\">\n+ <node concept=\"3uibUv\" id=\"63wwZGi_NZq\" role=\"HW$YZ\">\n+ <ref role=\"3uigEE\" to=\"ydze:1U0efzLyBFX\" resolve=\"IAppliedOperation\" />\n</node>\n- <node concept=\"3cpWs8\" id=\"51I69MocR83\" role=\"3cqZAp\">\n- <node concept=\"3cpWsn\" id=\"51I69MocR86\" role=\"3cpWs9\">\n- <property role=\"TrG5h\" value=\"operationsSinceSideChange\" />\n- <node concept=\"_YKpA\" id=\"51I69MocR7Z\" role=\"1tU5fm\">\n- <node concept=\"3uibUv\" id=\"51I69MocRjf\" role=\"_ZDj9\">\n- <ref role=\"3uigEE\" to=\"ydze:1U0efzLyBFz\" resolve=\"IOperation\" />\n</node>\n</node>\n- <node concept=\"2ShNRf\" id=\"51I69MocScn\" role=\"33vP2m\">\n- <node concept=\"Tc6Ow\" id=\"51I69MocRX7\" role=\"2ShVmc\">\n- <node concept=\"3uibUv\" id=\"51I69MocRX8\" role=\"HW$YZ\">\n- <ref role=\"3uigEE\" to=\"ydze:1U0efzLyBFz\" resolve=\"IOperation\" />\n+ </node>\n+ </node>\n+ <node concept=\"3cpWs8\" id=\"63wwZGi_ueF\" role=\"3cqZAp\">\n+ <node concept=\"3cpWsn\" id=\"63wwZGi_ueG\" role=\"3cpWs9\">\n+ <property role=\"TrG5h\" value=\"rightAppliedOps\" />\n+ <node concept=\"_YKpA\" id=\"63wwZGi_ueH\" role=\"1tU5fm\">\n+ <node concept=\"3uibUv\" id=\"63wwZGi_MlQ\" role=\"_ZDj9\">\n+ <ref role=\"3uigEE\" to=\"ydze:1U0efzLyBFX\" resolve=\"IAppliedOperation\" />\n+ </node>\n+ </node>\n+ <node concept=\"2ShNRf\" id=\"63wwZGi_ueJ\" role=\"33vP2m\">\n+ <node concept=\"Tc6Ow\" id=\"63wwZGi_ueK\" role=\"2ShVmc\">\n+ <node concept=\"3uibUv\" id=\"63wwZGi_Opi\" role=\"HW$YZ\">\n+ <ref role=\"3uigEE\" to=\"ydze:1U0efzLyBFX\" resolve=\"IAppliedOperation\" />\n</node>\n</node>\n</node>\n</node>\n</node>\n</node>\n- <node concept=\"3cpWs8\" id=\"51I69Mod8lp\" role=\"3cqZAp\">\n- <node concept=\"3cpWsn\" id=\"51I69Mod8ls\" role=\"3cpWs9\">\n- <property role=\"TrG5h\" value=\"sideChanged\" />\n- <node concept=\"10P_77\" id=\"51I69Mod8ln\" role=\"1tU5fm\" />\n- <node concept=\"3y3z36\" id=\"51I69Mod9mG\" role=\"33vP2m\">\n- <node concept=\"37vLTw\" id=\"51I69Mod9Ad\" role=\"3uHU7w\">\n- <ref role=\"3cqZAo\" node=\"51I69MocNXP\" resolve=\"useLeft\" />\n- </node>\n- <node concept=\"37vLTw\" id=\"51I69Mod8PN\" role=\"3uHU7B\">\n- <ref role=\"3cqZAo\" node=\"51I69MocsI5\" resolve=\"wasLeft\" />\n- </node>\n- </node>\n- </node>\n- </node>\n<node concept=\"3cpWs8\" id=\"51I69Modanj\" role=\"3cqZAp\">\n<node concept=\"3cpWsn\" id=\"51I69Modank\" role=\"3cpWs9\">\n<property role=\"TrG5h\" value=\"versionToApply\" />\n</node>\n</node>\n</node>\n+ <node concept=\"3cpWs8\" id=\"63wwZGiBjAD\" role=\"3cqZAp\">\n+ <node concept=\"3cpWsn\" id=\"63wwZGiBjAE\" role=\"3cpWs9\">\n+ <property role=\"TrG5h\" value=\"oppositeAppliedOps\" />\n+ <node concept=\"A3Dl8\" id=\"63wwZGiBj_5\" role=\"1tU5fm\">\n+ <node concept=\"3uibUv\" id=\"63wwZGiBj_8\" role=\"A3Ik2\">\n+ <ref role=\"3uigEE\" to=\"ydze:1U0efzLyBFz\" resolve=\"IOperation\" />\n+ </node>\n+ </node>\n+ <node concept=\"2OqwBi\" id=\"63wwZGiBjAF\" role=\"33vP2m\">\n+ <node concept=\"1eOMI4\" id=\"63wwZGiBjAG\" role=\"2Oq$k0\">\n+ <node concept=\"3K4zz7\" id=\"63wwZGiBjAH\" role=\"1eOMHV\">\n+ <node concept=\"37vLTw\" id=\"63wwZGiBjAI\" role=\"3K4E3e\">\n+ <ref role=\"3cqZAo\" node=\"63wwZGi_ueG\" resolve=\"rightAppliedOps\" />\n+ </node>\n+ <node concept=\"37vLTw\" id=\"63wwZGiBjAJ\" role=\"3K4GZi\">\n+ <ref role=\"3cqZAo\" node=\"63wwZGi_pXs\" resolve=\"leftAppliedOps\" />\n+ </node>\n+ <node concept=\"37vLTw\" id=\"63wwZGiBjAK\" role=\"3K4Cdx\">\n+ <ref role=\"3cqZAo\" node=\"51I69MocNXP\" resolve=\"useLeft\" />\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3$u5V9\" id=\"63wwZGiBjAL\" role=\"2OqNvi\">\n+ <node concept=\"1bVj0M\" id=\"63wwZGiBjAM\" role=\"23t8la\">\n+ <node concept=\"3clFbS\" id=\"63wwZGiBjAN\" role=\"1bW5cS\">\n+ <node concept=\"3clFbF\" id=\"63wwZGiBjAO\" role=\"3cqZAp\">\n+ <node concept=\"2OqwBi\" id=\"63wwZGiBjAP\" role=\"3clFbG\">\n+ <node concept=\"37vLTw\" id=\"63wwZGiBjAQ\" role=\"2Oq$k0\">\n+ <ref role=\"3cqZAo\" node=\"63wwZGiBjAS\" resolve=\"it\" />\n+ </node>\n+ <node concept=\"liA8E\" id=\"63wwZGiBjAR\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" to=\"ydze:1U0efzLyRfF\" resolve=\"getOriginalOp\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"Rh6nW\" id=\"63wwZGiBjAS\" role=\"1bW2Oz\">\n+ <property role=\"TrG5h\" value=\"it\" />\n+ <node concept=\"2jxLKc\" id=\"63wwZGiBjAT\" role=\"1tU5fm\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n<node concept=\"3cpWs8\" id=\"51I69MojC2f\" role=\"3cqZAp\">\n<node concept=\"3cpWsn\" id=\"51I69MojC2g\" role=\"3cpWs9\">\n<property role=\"TrG5h\" value=\"operationsToApply\" />\n<node concept=\"37vLTw\" id=\"51I69MojC2t\" role=\"37wK5m\">\n<ref role=\"3cqZAo\" node=\"51I69MojC2v\" resolve=\"it\" />\n</node>\n- <node concept=\"37vLTw\" id=\"51I69MojC2u\" role=\"37wK5m\">\n- <ref role=\"3cqZAo\" node=\"51I69MocR86\" resolve=\"operationsSinceSideChange\" />\n+ <node concept=\"37vLTw\" id=\"63wwZGiBndc\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"63wwZGiBjAE\" resolve=\"oppositeAppliedOps\" />\n</node>\n</node>\n</node>\n<ref role=\"3cqZAo\" node=\"51I69MojC2g\" resolve=\"operationsToApply\" />\n</node>\n<node concept=\"3clFbS\" id=\"51I69MojPSb\" role=\"2LFqv$\">\n- <node concept=\"3clFbF\" id=\"51I69MojR$4\" role=\"3cqZAp\">\n- <node concept=\"2OqwBi\" id=\"51I69MojRUv\" role=\"3clFbG\">\n- <node concept=\"2GrUjf\" id=\"51I69MojR$3\" role=\"2Oq$k0\">\n+ <node concept=\"3cpWs8\" id=\"63wwZGi_PjL\" role=\"3cqZAp\">\n+ <node concept=\"3cpWsn\" id=\"63wwZGi_PjM\" role=\"3cpWs9\">\n+ <property role=\"TrG5h\" value=\"appliedOp\" />\n+ <node concept=\"3uibUv\" id=\"63wwZGi_PhR\" role=\"1tU5fm\">\n+ <ref role=\"3uigEE\" to=\"ydze:1U0efzLyBFX\" resolve=\"IAppliedOperation\" />\n+ </node>\n+ <node concept=\"2OqwBi\" id=\"63wwZGi_PjN\" role=\"33vP2m\">\n+ <node concept=\"2GrUjf\" id=\"63wwZGi_PjO\" role=\"2Oq$k0\">\n<ref role=\"2Gs0qQ\" node=\"51I69MojPS7\" resolve=\"op\" />\n</node>\n- <node concept=\"liA8E\" id=\"51I69MokEF_\" role=\"2OqNvi\">\n+ <node concept=\"liA8E\" id=\"63wwZGi_PjP\" role=\"2OqNvi\">\n<ref role=\"37wK5l\" to=\"ydze:1U0efzLyR7X\" resolve=\"apply\" />\n- <node concept=\"37vLTw\" id=\"51I69MokFdT\" role=\"37wK5m\">\n+ <node concept=\"37vLTw\" id=\"63wwZGi_PjQ\" role=\"37wK5m\">\n<ref role=\"3cqZAo\" node=\"51I69Mocslh\" resolve=\"t\" />\n</node>\n</node>\n</node>\n</node>\n</node>\n+ <node concept=\"3clFbJ\" id=\"63wwZGi_QSp\" role=\"3cqZAp\">\n+ <node concept=\"3clFbS\" id=\"63wwZGi_QSr\" role=\"3clFbx\">\n+ <node concept=\"3clFbF\" id=\"63wwZGi_Sm9\" role=\"3cqZAp\">\n+ <node concept=\"2OqwBi\" id=\"63wwZGi_TwM\" role=\"3clFbG\">\n+ <node concept=\"37vLTw\" id=\"63wwZGi_Sm7\" role=\"2Oq$k0\">\n+ <ref role=\"3cqZAo\" node=\"63wwZGi_pXs\" resolve=\"leftAppliedOps\" />\n+ </node>\n+ <node concept=\"TSZUe\" id=\"63wwZGi_Wi_\" role=\"2OqNvi\">\n+ <node concept=\"37vLTw\" id=\"63wwZGiA32a\" role=\"25WWJ7\">\n+ <ref role=\"3cqZAo\" node=\"63wwZGi_PjM\" resolve=\"appliedOp\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"37vLTw\" id=\"63wwZGi_RBn\" role=\"3clFbw\">\n+ <ref role=\"3cqZAo\" node=\"51I69MocNXP\" resolve=\"useLeft\" />\n+ </node>\n+ <node concept=\"9aQIb\" id=\"63wwZGi_Xsr\" role=\"9aQIa\">\n+ <node concept=\"3clFbS\" id=\"63wwZGi_Xss\" role=\"9aQI4\">\n+ <node concept=\"3clFbF\" id=\"63wwZGi_Ycs\" role=\"3cqZAp\">\n+ <node concept=\"2OqwBi\" id=\"63wwZGi_Zoy\" role=\"3clFbG\">\n+ <node concept=\"37vLTw\" id=\"63wwZGi_Ycr\" role=\"2Oq$k0\">\n+ <ref role=\"3cqZAo\" node=\"63wwZGi_ueG\" resolve=\"rightAppliedOps\" />\n+ </node>\n+ <node concept=\"TSZUe\" id=\"63wwZGiA2dU\" role=\"2OqNvi\">\n+ <node concept=\"37vLTw\" id=\"63wwZGiA3NH\" role=\"25WWJ7\">\n+ <ref role=\"3cqZAo\" node=\"63wwZGi_PjM\" resolve=\"appliedOp\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n</node>\n<node concept=\"3clFbH\" id=\"51I69MokXzO\" role=\"3cqZAp\" />\n<node concept=\"3clFbF\" id=\"51I69Mol1dY\" role=\"3cqZAp\">\n</node>\n</node>\n</node>\n- <node concept=\"3clFbH\" id=\"51I69MokXUF\" role=\"3cqZAp\" />\n- <node concept=\"3clFbJ\" id=\"51I69MojEaR\" role=\"3cqZAp\">\n- <node concept=\"3clFbS\" id=\"51I69MojEaT\" role=\"3clFbx\">\n- <node concept=\"3clFbF\" id=\"51I69MojDC1\" role=\"3cqZAp\">\n- <node concept=\"2OqwBi\" id=\"51I69MojFOe\" role=\"3clFbG\">\n- <node concept=\"37vLTw\" id=\"51I69MojDBZ\" role=\"2Oq$k0\">\n- <ref role=\"3cqZAo\" node=\"51I69MocR86\" resolve=\"operationsSinceSideChange\" />\n- </node>\n- <node concept=\"2Kehj3\" id=\"51I69MojIr$\" role=\"2OqNvi\" />\n- </node>\n- </node>\n- </node>\n- <node concept=\"37vLTw\" id=\"51I69MojEIt\" role=\"3clFbw\">\n- <ref role=\"3cqZAo\" node=\"51I69Mod8ls\" resolve=\"sideChanged\" />\n- </node>\n- </node>\n- <node concept=\"3clFbF\" id=\"51I69MojKoZ\" role=\"3cqZAp\">\n- <node concept=\"2OqwBi\" id=\"51I69MojLnW\" role=\"3clFbG\">\n- <node concept=\"37vLTw\" id=\"51I69MojKoX\" role=\"2Oq$k0\">\n- <ref role=\"3cqZAo\" node=\"51I69MocR86\" resolve=\"operationsSinceSideChange\" />\n- </node>\n- <node concept=\"X8dFx\" id=\"51I69MojNYR\" role=\"2OqNvi\">\n- <node concept=\"37vLTw\" id=\"51I69MojO_S\" role=\"25WWJ7\">\n- <ref role=\"3cqZAo\" node=\"51I69MojC2g\" resolve=\"operationsToApply\" />\n- </node>\n- </node>\n- </node>\n- </node>\n</node>\n<node concept=\"22lmx$\" id=\"51I69Mod7vF\" role=\"2$JKZa\">\n<node concept=\"2OqwBi\" id=\"51I69MocTVW\" role=\"3uHU7B\">\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
OT: When merging two versions some operations were transformed against the wrong operations
426,496
07.08.2019 16:18:41
-7,200
2738a994d5269e10f0d45dfb5b7bce100503ea05
Delete detached nodes at the end of a command
[ { "change_type": "MODIFY", "old_path": "mps/de.q60.mps.web.model.mpsplugin/models/de.q60.mps.web.model.mpsplugin.mps", "new_path": "mps/de.q60.mps.web.model.mpsplugin/models/de.q60.mps.web.model.mpsplugin.mps", "diff": "<node concept=\"3Tm1VV\" id=\"51I69MoqMUm\" role=\"1B3o_S\" />\n<node concept=\"3cqZAl\" id=\"51I69MoqMUn\" role=\"3clF45\" />\n<node concept=\"3clFbS\" id=\"51I69MoqMUo\" role=\"3clF47\">\n+ <node concept=\"3clFbF\" id=\"5h91CE_dkrk\" role=\"3cqZAp\">\n+ <node concept=\"2OqwBi\" id=\"5h91CE_dmcF\" role=\"3clFbG\">\n+ <node concept=\"37vLTw\" id=\"5h91CE_dkri\" role=\"2Oq$k0\">\n+ <ref role=\"3cqZAo\" node=\"51I69MorShl\" resolve=\"otBranch\" />\n+ </node>\n+ <node concept=\"liA8E\" id=\"5h91CE_dnor\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" to=\"ydze:1U0efzL$263\" resolve=\"runWrite\" />\n+ <node concept=\"1bVj0M\" id=\"5h91CE_eR8i\" role=\"37wK5m\">\n+ <node concept=\"3clFbS\" id=\"5h91CE_eR8k\" role=\"1bW5cS\">\n+ <node concept=\"3SKdUt\" id=\"5h91CE_eUvo\" role=\"3cqZAp\">\n+ <node concept=\"3SKdUq\" id=\"5h91CE_eUvq\" role=\"3SKWNk\">\n+ <property role=\"3SKdUp\" value=\"clear detached nodes\" />\n+ </node>\n+ </node>\n+ <node concept=\"3cpWs8\" id=\"5h91CE_e4M5\" role=\"3cqZAp\">\n+ <node concept=\"3cpWsn\" id=\"5h91CE_e4M6\" role=\"3cpWs9\">\n+ <property role=\"TrG5h\" value=\"t\" />\n+ <node concept=\"3uibUv\" id=\"5h91CE_e4M2\" role=\"1tU5fm\">\n+ <ref role=\"3uigEE\" to=\"3hky:4_SQzDOc0eq\" resolve=\"IWriteTransaction\" />\n+ </node>\n+ <node concept=\"2OqwBi\" id=\"5h91CE_e4M7\" role=\"33vP2m\">\n+ <node concept=\"37vLTw\" id=\"5h91CE_eStE\" role=\"2Oq$k0\">\n+ <ref role=\"3cqZAo\" node=\"51I69MorShl\" resolve=\"otBranch\" />\n+ </node>\n+ <node concept=\"liA8E\" id=\"5h91CE_e4M9\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" to=\"ydze:1U0efzL$25E\" resolve=\"getWriteTransaction\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"2Gpval\" id=\"5h91CE_eaQw\" role=\"3cqZAp\">\n+ <node concept=\"2GrKxI\" id=\"5h91CE_eaQy\" role=\"2Gsz3X\">\n+ <property role=\"TrG5h\" value=\"nodeId\" />\n+ </node>\n+ <node concept=\"3clFbS\" id=\"5h91CE_eaQA\" role=\"2LFqv$\">\n+ <node concept=\"3clFbF\" id=\"5h91CE_ecW7\" role=\"3cqZAp\">\n+ <node concept=\"2OqwBi\" id=\"5h91CE_ed65\" role=\"3clFbG\">\n+ <node concept=\"37vLTw\" id=\"5h91CE_ecW6\" role=\"2Oq$k0\">\n+ <ref role=\"3cqZAo\" node=\"5h91CE_e4M6\" resolve=\"t\" />\n+ </node>\n+ <node concept=\"liA8E\" id=\"5h91CE_efwX\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" to=\"3hky:4_SQzDOnYpN\" resolve=\"deleteNode\" />\n+ <node concept=\"2GrUjf\" id=\"5h91CE_efLJ\" role=\"37wK5m\">\n+ <ref role=\"2Gs0qQ\" node=\"5h91CE_eaQy\" resolve=\"nodeId\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"2OqwBi\" id=\"5h91CE_eaWY\" role=\"2GsD0m\">\n+ <node concept=\"37vLTw\" id=\"5h91CE_eaWZ\" role=\"2Oq$k0\">\n+ <ref role=\"3cqZAo\" node=\"5h91CE_e4M6\" resolve=\"t\" />\n+ </node>\n+ <node concept=\"liA8E\" id=\"5h91CE_eaX0\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" to=\"3hky:4_SQzDOeddK\" resolve=\"getChildren\" />\n+ <node concept=\"10M0yZ\" id=\"5h91CE_eaX1\" role=\"37wK5m\">\n+ <ref role=\"1PxDUh\" to=\"3hky:4_SQzDO0jRP\" resolve=\"PTree\" />\n+ <ref role=\"3cqZAo\" to=\"3hky:5QP6xyjNAP1\" resolve=\"ROOT_ID\" />\n+ </node>\n+ <node concept=\"10M0yZ\" id=\"5h91CE_eEkY\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"4TPMxtdwm8M\" resolve=\"DETACHED_NODES_ROLE\" />\n+ <ref role=\"1PxDUh\" node=\"4TPMxtdCfK_\" resolve=\"ModelSynchronizer\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n<node concept=\"3clFbF\" id=\"51I69MosvX4\" role=\"3cqZAp\">\n<node concept=\"2OqwBi\" id=\"51I69MoswWk\" role=\"3clFbG\">\n<node concept=\"37vLTw\" id=\"51I69MosvX2\" role=\"2Oq$k0\">\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
Delete detached nodes at the end of a command
426,496
07.08.2019 17:17:12
-7,200
3a892aff4f60a9034f3da1643f5f1be9756a18f2
Allow to switch between auto/manual merge for testing/demonstration purposes
[ { "change_type": "MODIFY", "old_path": "mps/de.q60.mps.web.model.mpsplugin/models/de.q60.mps.web.model.mpsplugin.history.mps", "new_path": "mps/de.q60.mps.web.model.mpsplugin/models/de.q60.mps.web.model.mpsplugin.history.mps", "diff": "<child id=\"1068498886295\" name=\"lValue\" index=\"37vLTJ\" />\n</concept>\n<concept id=\"1153422305557\" name=\"jetbrains.mps.baseLanguage.structure.LessThanOrEqualsExpression\" flags=\"nn\" index=\"2dkUwp\" />\n+ <concept id=\"4836112446988635817\" name=\"jetbrains.mps.baseLanguage.structure.UndefinedType\" flags=\"in\" index=\"2jxLKc\" />\n<concept id=\"1202948039474\" name=\"jetbrains.mps.baseLanguage.structure.InstanceMethodCallOperation\" flags=\"nn\" index=\"liA8E\" />\n<concept id=\"1465982738277781862\" name=\"jetbrains.mps.baseLanguage.structure.PlaceholderMember\" flags=\"ng\" index=\"2tJIrI\" />\n<concept id=\"1076505808687\" name=\"jetbrains.mps.baseLanguage.structure.WhileStatement\" flags=\"nn\" index=\"2$JKZl\">\n</language>\n<language id=\"fd392034-7849-419d-9071-12563d152375\" name=\"jetbrains.mps.baseLanguage.closures\">\n<concept id=\"1199569711397\" name=\"jetbrains.mps.baseLanguage.closures.structure.ClosureLiteral\" flags=\"nn\" index=\"1bVj0M\">\n+ <property id=\"890797661671409019\" name=\"forceMultiLine\" index=\"3yWfEV\" />\n<child id=\"1199569906740\" name=\"parameter\" index=\"1bW2Oz\" />\n<child id=\"1199569916463\" name=\"body\" index=\"1bW5cS\" />\n</concept>\n</concept>\n</language>\n<language id=\"83888646-71ce-4f1c-9c53-c54016f6ad4f\" name=\"jetbrains.mps.baseLanguage.collections\">\n+ <concept id=\"1204796164442\" name=\"jetbrains.mps.baseLanguage.collections.structure.InternalSequenceOperation\" flags=\"nn\" index=\"23sCx2\">\n+ <child id=\"1204796294226\" name=\"closure\" index=\"23t8la\" />\n+ </concept>\n<concept id=\"540871147943773365\" name=\"jetbrains.mps.baseLanguage.collections.structure.SingleArgumentSequenceOperation\" flags=\"nn\" index=\"25WWJ4\">\n<child id=\"540871147943773366\" name=\"argument\" index=\"25WWJ7\" />\n</concept>\n<child id=\"1237721435807\" name=\"elementType\" index=\"HW$YZ\" />\n</concept>\n<concept id=\"1227022210526\" name=\"jetbrains.mps.baseLanguage.collections.structure.ClearAllElementsOperation\" flags=\"nn\" index=\"2Kehj3\" />\n+ <concept id=\"1203518072036\" name=\"jetbrains.mps.baseLanguage.collections.structure.SmartClosureParameterDeclaration\" flags=\"ig\" index=\"Rh6nW\" />\n<concept id=\"1160600644654\" name=\"jetbrains.mps.baseLanguage.collections.structure.ListCreatorWithInit\" flags=\"nn\" index=\"Tc6Ow\" />\n<concept id=\"1160612413312\" name=\"jetbrains.mps.baseLanguage.collections.structure.AddElementOperation\" flags=\"nn\" index=\"TSZUe\" />\n<concept id=\"1162935959151\" name=\"jetbrains.mps.baseLanguage.collections.structure.GetSizeOperation\" flags=\"nn\" index=\"34oBXx\" />\n+ <concept id=\"1240687580870\" name=\"jetbrains.mps.baseLanguage.collections.structure.JoinOperation\" flags=\"nn\" index=\"3uJxvA\">\n+ <child id=\"1240687658305\" name=\"delimiter\" index=\"3uJOhx\" />\n+ </concept>\n<concept id=\"1225711141656\" name=\"jetbrains.mps.baseLanguage.collections.structure.ListElementAccessExpression\" flags=\"nn\" index=\"1y4W85\">\n<child id=\"1225711182005\" name=\"list\" index=\"1y566C\" />\n<child id=\"1225711191269\" name=\"index\" index=\"1y58nS\" />\n</concept>\n+ <concept id=\"1202128969694\" name=\"jetbrains.mps.baseLanguage.collections.structure.SelectOperation\" flags=\"nn\" index=\"3$u5V9\" />\n</language>\n</registry>\n<node concept=\"312cEu\" id=\"2D0HTQh99kz\">\n</node>\n</node>\n</node>\n+ <node concept=\"3clFbH\" id=\"5h91CE_h7FM\" role=\"3cqZAp\" />\n+ <node concept=\"3cpWs8\" id=\"5h91CE_h9Lc\" role=\"3cqZAp\">\n+ <node concept=\"3cpWsn\" id=\"5h91CE_h9Ld\" role=\"3cpWs9\">\n+ <property role=\"TrG5h\" value=\"autoMergeCheckbox\" />\n+ <node concept=\"3uibUv\" id=\"5h91CE_h9Le\" role=\"1tU5fm\">\n+ <ref role=\"3uigEE\" to=\"dxuu:~JCheckBox\" resolve=\"JCheckBox\" />\n+ </node>\n+ <node concept=\"2ShNRf\" id=\"5h91CE_hbOm\" role=\"33vP2m\">\n+ <node concept=\"1pGfFk\" id=\"5h91CE_hbpW\" role=\"2ShVmc\">\n+ <ref role=\"37wK5l\" to=\"dxuu:~JCheckBox.&lt;init&gt;(java.lang.String)\" resolve=\"JCheckBox\" />\n+ <node concept=\"Xl_RD\" id=\"5h91CE_hcf7\" role=\"37wK5m\">\n+ <property role=\"Xl_RC\" value=\"Auto Merge\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3clFbF\" id=\"5h91CE_hdXP\" role=\"3cqZAp\">\n+ <node concept=\"2OqwBi\" id=\"5h91CE_hfDc\" role=\"3clFbG\">\n+ <node concept=\"37vLTw\" id=\"5h91CE_hdXN\" role=\"2Oq$k0\">\n+ <ref role=\"3cqZAo\" node=\"2D0HTQhaDde\" resolve=\"buttons\" />\n+ </node>\n+ <node concept=\"liA8E\" id=\"5h91CE_hm4V\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" to=\"z60i:~Container.add(java.awt.Component)\" resolve=\"add\" />\n+ <node concept=\"37vLTw\" id=\"5h91CE_hnpr\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"5h91CE_h9Ld\" resolve=\"autoMergeCheckbox\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3clFbF\" id=\"5h91CE_hGIO\" role=\"3cqZAp\">\n+ <node concept=\"2OqwBi\" id=\"5h91CE_hJ7G\" role=\"3clFbG\">\n+ <node concept=\"37vLTw\" id=\"5h91CE_hGIM\" role=\"2Oq$k0\">\n+ <ref role=\"3cqZAo\" node=\"5h91CE_h9Ld\" resolve=\"autoMergeCheckbox\" />\n+ </node>\n+ <node concept=\"liA8E\" id=\"5h91CE_hLaV\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" to=\"dxuu:~AbstractButton.setSelected(boolean)\" resolve=\"setSelected\" />\n+ <node concept=\"2OqwBi\" id=\"5h91CE_hLH2\" role=\"37wK5m\">\n+ <node concept=\"2YIFZM\" id=\"5h91CE_hLtf\" role=\"2Oq$k0\">\n+ <ref role=\"37wK5l\" to=\"csg2:2D0HTQhbLCs\" resolve=\"getInstance\" />\n+ <ref role=\"1Pybhc\" to=\"csg2:68rqGk1601\" resolve=\"CollaborativeEditing\" />\n+ </node>\n+ <node concept=\"liA8E\" id=\"5h91CE_hMdx\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" to=\"csg2:5h91CE_gN_e\" resolve=\"isAutoMerge\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3clFbF\" id=\"5h91CE_hVz0\" role=\"3cqZAp\">\n+ <node concept=\"2OqwBi\" id=\"5h91CE_hY0p\" role=\"3clFbG\">\n+ <node concept=\"37vLTw\" id=\"5h91CE_hVyY\" role=\"2Oq$k0\">\n+ <ref role=\"3cqZAo\" node=\"5h91CE_h9Ld\" resolve=\"autoMergeCheckbox\" />\n+ </node>\n+ <node concept=\"liA8E\" id=\"5h91CE_i1KI\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" to=\"dxuu:~AbstractButton.addActionListener(java.awt.event.ActionListener)\" resolve=\"addActionListener\" />\n+ <node concept=\"1bVj0M\" id=\"5h91CE_i2Vl\" role=\"37wK5m\">\n+ <property role=\"3yWfEV\" value=\"true\" />\n+ <node concept=\"37vLTG\" id=\"5h91CE_i8Tp\" role=\"1bW2Oz\">\n+ <property role=\"TrG5h\" value=\"e\" />\n+ <node concept=\"3uibUv\" id=\"5h91CE_i9r4\" role=\"1tU5fm\">\n+ <ref role=\"3uigEE\" to=\"hyam:~ActionEvent\" resolve=\"ActionEvent\" />\n+ </node>\n+ </node>\n+ <node concept=\"3clFbS\" id=\"5h91CE_i2Vm\" role=\"1bW5cS\">\n+ <node concept=\"3clFbF\" id=\"5h91CE_i3a7\" role=\"3cqZAp\">\n+ <node concept=\"2OqwBi\" id=\"5h91CE_i3a9\" role=\"3clFbG\">\n+ <node concept=\"2YIFZM\" id=\"5h91CE_i3aa\" role=\"2Oq$k0\">\n+ <ref role=\"37wK5l\" to=\"csg2:2D0HTQhbLCs\" resolve=\"getInstance\" />\n+ <ref role=\"1Pybhc\" to=\"csg2:68rqGk1601\" resolve=\"CollaborativeEditing\" />\n+ </node>\n+ <node concept=\"liA8E\" id=\"5h91CE_i3E_\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" to=\"csg2:5h91CE_g$Sw\" resolve=\"setAutoMerge\" />\n+ <node concept=\"2OqwBi\" id=\"5h91CE_i5U1\" role=\"37wK5m\">\n+ <node concept=\"37vLTw\" id=\"5h91CE_i4_Y\" role=\"2Oq$k0\">\n+ <ref role=\"3cqZAo\" node=\"5h91CE_h9Ld\" resolve=\"autoMergeCheckbox\" />\n+ </node>\n+ <node concept=\"liA8E\" id=\"5h91CE_i8ui\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" to=\"dxuu:~AbstractButton.isSelected()\" resolve=\"isSelected\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3clFbJ\" id=\"5h91CE_ibzv\" role=\"3cqZAp\">\n+ <node concept=\"3clFbS\" id=\"5h91CE_ibzx\" role=\"3clFbx\">\n+ <node concept=\"3clFbF\" id=\"5h91CE_ia9J\" role=\"3cqZAp\">\n+ <node concept=\"2OqwBi\" id=\"5h91CE_iaq2\" role=\"3clFbG\">\n+ <node concept=\"2YIFZM\" id=\"5h91CE_ia9L\" role=\"2Oq$k0\">\n+ <ref role=\"37wK5l\" to=\"csg2:2D0HTQhbLCs\" resolve=\"getInstance\" />\n+ <ref role=\"1Pybhc\" to=\"csg2:68rqGk1601\" resolve=\"CollaborativeEditing\" />\n+ </node>\n+ <node concept=\"liA8E\" id=\"5h91CE_icX7\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" to=\"csg2:5oJTJC89M6r\" resolve=\"processPendingRemoteVersion\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"2OqwBi\" id=\"5h91CE_ibGH\" role=\"3clFbw\">\n+ <node concept=\"37vLTw\" id=\"5h91CE_ibGI\" role=\"2Oq$k0\">\n+ <ref role=\"3cqZAo\" node=\"5h91CE_h9Ld\" resolve=\"autoMergeCheckbox\" />\n+ </node>\n+ <node concept=\"liA8E\" id=\"5h91CE_ibGJ\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" to=\"dxuu:~AbstractButton.isSelected()\" resolve=\"isSelected\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n</node>\n</node>\n<node concept=\"2tJIrI\" id=\"2D0HTQh9kdl\" role=\"jymVt\" />\n<ref role=\"37wK5l\" to=\"jon5:2D0HTQhatcJ\" resolve=\"getTime\" />\n</node>\n</node>\n- <node concept=\"2OqwBi\" id=\"2D0HTQhcXvu\" role=\"HW$Y0\">\n+ <node concept=\"2OqwBi\" id=\"5h91CE_fDBa\" role=\"HW$Y0\">\n+ <node concept=\"2OqwBi\" id=\"5h91CE_fwQV\" role=\"2Oq$k0\">\n+ <node concept=\"2OqwBi\" id=\"2D0HTQhcXvu\" role=\"2Oq$k0\">\n<node concept=\"37vLTw\" id=\"2D0HTQhcXvv\" role=\"2Oq$k0\">\n<ref role=\"3cqZAo\" node=\"2D0HTQhc7of\" resolve=\"version\" />\n</node>\n<ref role=\"37wK5l\" to=\"jon5:2D0HTQhaxkO\" resolve=\"getOperations\" />\n</node>\n</node>\n+ <node concept=\"3$u5V9\" id=\"5h91CE_f$fG\" role=\"2OqNvi\">\n+ <node concept=\"1bVj0M\" id=\"5h91CE_f$fI\" role=\"23t8la\">\n+ <node concept=\"3clFbS\" id=\"5h91CE_f$fJ\" role=\"1bW5cS\">\n+ <node concept=\"3clFbF\" id=\"5h91CE_f_8Z\" role=\"3cqZAp\">\n+ <node concept=\"2OqwBi\" id=\"5h91CE_f_xv\" role=\"3clFbG\">\n+ <node concept=\"37vLTw\" id=\"5h91CE_f_8Y\" role=\"2Oq$k0\">\n+ <ref role=\"3cqZAo\" node=\"5h91CE_f$fK\" resolve=\"it\" />\n+ </node>\n+ <node concept=\"liA8E\" id=\"5h91CE_fCw3\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" to=\"wyt6:~Object.toString()\" resolve=\"toString\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"Rh6nW\" id=\"5h91CE_f$fK\" role=\"1bW2Oz\">\n+ <property role=\"TrG5h\" value=\"it\" />\n+ <node concept=\"2jxLKc\" id=\"5h91CE_f$fL\" role=\"1tU5fm\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3uJxvA\" id=\"5h91CE_fNGu\" role=\"2OqNvi\">\n+ <node concept=\"Xl_RD\" id=\"5h91CE_fY55\" role=\"3uJOhx\">\n+ <property role=\"Xl_RC\" value=\" # \" />\n+ </node>\n+ </node>\n+ </node>\n<node concept=\"2OqwBi\" id=\"2D0HTQhcXvy\" role=\"HW$Y0\">\n<node concept=\"37vLTw\" id=\"2D0HTQhcXvz\" role=\"2Oq$k0\">\n<ref role=\"3cqZAo\" node=\"2D0HTQhc7of\" resolve=\"version\" />\n" }, { "change_type": "MODIFY", "old_path": "mps/de.q60.mps.web.model.mpsplugin/models/de.q60.mps.web.model.mpsplugin.mps", "new_path": "mps/de.q60.mps.web.model.mpsplugin/models/de.q60.mps.web.model.mpsplugin.mps", "diff": "</node>\n</node>\n</node>\n+ <node concept=\"3clFbF\" id=\"4jf43puRaMw\" role=\"3cqZAp\">\n+ <node concept=\"2OqwBi\" id=\"4jf43puReFm\" role=\"3clFbG\">\n+ <node concept=\"2YIFZM\" id=\"4jf43puRbcC\" role=\"2Oq$k0\">\n+ <ref role=\"37wK5l\" to=\"bd8o:~ApplicationManager.getApplication()\" resolve=\"getApplication\" />\n+ <ref role=\"1Pybhc\" to=\"bd8o:~ApplicationManager\" resolve=\"ApplicationManager\" />\n+ </node>\n+ <node concept=\"liA8E\" id=\"4jf43puRffQ\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" to=\"bd8o:~Application.invokeLater(java.lang.Runnable)\" resolve=\"invokeLater\" />\n+ <node concept=\"1bVj0M\" id=\"4jf43puRiPx\" role=\"37wK5m\">\n+ <node concept=\"3clFbS\" id=\"4jf43puRiPy\" role=\"1bW5cS\">\n<node concept=\"3clFbF\" id=\"4TPMxte71yP\" role=\"3cqZAp\">\n<node concept=\"1rXfSq\" id=\"4TPMxte71yN\" role=\"3clFbG\">\n<ref role=\"37wK5l\" node=\"3l$kG67pN9J\" resolve=\"withSyncMuted\" />\n</node>\n</node>\n</node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n<node concept=\"2AHcQZ\" id=\"7Zr9caICX0j\" role=\"2AJF6D\">\n<ref role=\"2AI5Lk\" to=\"wyt6:~Override\" resolve=\"Override\" />\n</node>\n<node concept=\"3Tm6S6\" id=\"5oJTJC89Cga\" role=\"1B3o_S\" />\n<node concept=\"17QB3L\" id=\"5oJTJC89EEx\" role=\"1tU5fm\" />\n</node>\n+ <node concept=\"312cEg\" id=\"5h91CE_guWQ\" role=\"jymVt\">\n+ <property role=\"TrG5h\" value=\"autoMerge\" />\n+ <node concept=\"3Tm6S6\" id=\"5h91CE_guWR\" role=\"1B3o_S\" />\n+ <node concept=\"10P_77\" id=\"5h91CE_gxr0\" role=\"1tU5fm\" />\n+ <node concept=\"3clFbT\" id=\"5h91CE_gyca\" role=\"33vP2m\">\n+ <property role=\"3clFbU\" value=\"true\" />\n+ </node>\n+ </node>\n<node concept=\"2tJIrI\" id=\"5oJTJC89_PT\" role=\"jymVt\" />\n<node concept=\"312cEg\" id=\"51I69MoqMU8\" role=\"jymVt\">\n<property role=\"TrG5h\" value=\"commandListener\" />\n</node>\n</node>\n</node>\n+ <node concept=\"3clFbJ\" id=\"5h91CE_h1op\" role=\"3cqZAp\">\n+ <node concept=\"3clFbS\" id=\"5h91CE_h1or\" role=\"3clFbx\">\n+ <node concept=\"3clFbF\" id=\"5h91CE_gsup\" role=\"3cqZAp\">\n+ <node concept=\"1rXfSq\" id=\"5h91CE_gsun\" role=\"3clFbG\">\n+ <ref role=\"37wK5l\" node=\"5oJTJC89M6r\" resolve=\"processPendingRemoteVersion\" />\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"37vLTw\" id=\"5h91CE_h2wG\" role=\"3clFbw\">\n+ <ref role=\"3cqZAo\" node=\"5h91CE_guWQ\" resolve=\"autoMerge\" />\n+ </node>\n+ </node>\n</node>\n<node concept=\"2AHcQZ\" id=\"74SroTqJocx\" role=\"2AJF6D\">\n<ref role=\"2AI5Lk\" to=\"wyt6:~Override\" resolve=\"Override\" />\n</node>\n</node>\n<node concept=\"2tJIrI\" id=\"74SroTqJscS\" role=\"jymVt\" />\n+ <node concept=\"3clFb_\" id=\"5h91CE_g$Sw\" role=\"jymVt\">\n+ <property role=\"TrG5h\" value=\"setAutoMerge\" />\n+ <node concept=\"37vLTG\" id=\"5h91CE_gG$p\" role=\"3clF46\">\n+ <property role=\"TrG5h\" value=\"value\" />\n+ <node concept=\"10P_77\" id=\"5h91CE_gISl\" role=\"1tU5fm\" />\n+ </node>\n+ <node concept=\"3cqZAl\" id=\"5h91CE_g$Sy\" role=\"3clF45\" />\n+ <node concept=\"3Tm1VV\" id=\"5h91CE_g$Sz\" role=\"1B3o_S\" />\n+ <node concept=\"3clFbS\" id=\"5h91CE_g$S$\" role=\"3clF47\">\n+ <node concept=\"3clFbF\" id=\"5h91CE_gJdG\" role=\"3cqZAp\">\n+ <node concept=\"37vLTI\" id=\"5h91CE_gKi2\" role=\"3clFbG\">\n+ <node concept=\"37vLTw\" id=\"5h91CE_gKL5\" role=\"37vLTx\">\n+ <ref role=\"3cqZAo\" node=\"5h91CE_gG$p\" resolve=\"value\" />\n+ </node>\n+ <node concept=\"2OqwBi\" id=\"5h91CE_gJuF\" role=\"37vLTJ\">\n+ <node concept=\"Xjq3P\" id=\"5h91CE_gJdF\" role=\"2Oq$k0\" />\n+ <node concept=\"2OwXpG\" id=\"5h91CE_gJKk\" role=\"2OqNvi\">\n+ <ref role=\"2Oxat5\" node=\"5h91CE_guWQ\" resolve=\"autoMerge\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"2tJIrI\" id=\"5h91CE_gKTw\" role=\"jymVt\" />\n+ <node concept=\"3clFb_\" id=\"5h91CE_gN_e\" role=\"jymVt\">\n+ <property role=\"TrG5h\" value=\"isAutoMerge\" />\n+ <node concept=\"10P_77\" id=\"5h91CE_gYxz\" role=\"3clF45\" />\n+ <node concept=\"3Tm1VV\" id=\"5h91CE_gN_h\" role=\"1B3o_S\" />\n+ <node concept=\"3clFbS\" id=\"5h91CE_gN_i\" role=\"3clF47\">\n+ <node concept=\"3clFbF\" id=\"5h91CE_gXNn\" role=\"3cqZAp\">\n+ <node concept=\"2OqwBi\" id=\"5h91CE_gY4m\" role=\"3clFbG\">\n+ <node concept=\"Xjq3P\" id=\"5h91CE_gXNm\" role=\"2Oq$k0\" />\n+ <node concept=\"2OwXpG\" id=\"5h91CE_gYlT\" role=\"2OqNvi\">\n+ <ref role=\"2Oxat5\" node=\"5h91CE_guWQ\" resolve=\"autoMerge\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"2tJIrI\" id=\"5h91CE_gyq1\" role=\"jymVt\" />\n<node concept=\"3clFb_\" id=\"5oJTJC89M6r\" role=\"jymVt\">\n<property role=\"TrG5h\" value=\"processPendingRemoteVersion\" />\n<node concept=\"3cqZAl\" id=\"5oJTJC89M6t\" role=\"3clF45\" />\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
Allow to switch between auto/manual merge for testing/demonstration purposes
426,496
09.08.2019 13:19:26
-7,200
226834d2482649d0f96bac5bd1b28b4363df1266
Run RCP build on travis
[ { "change_type": "MODIFY", "old_path": ".travis.yml", "new_path": ".travis.yml", "diff": "@@ -4,7 +4,7 @@ install: true\njdk: openjdk8\nscript:\n- - ./gradlew build_languages\n+ - ./gradlew build_languages build_rcp\ncache:\ndirectories:\n" }, { "change_type": "MODIFY", "old_path": "build.gradle", "new_path": "build.gradle", "diff": "@@ -141,7 +141,7 @@ task build_rcp_branding(type: BuildLanguages, dependsOn: [allScripts, resolveMps\nscript new File(\"$rootDir/mps/build-branding.xml\")\n}\n-task build_rcp_distribution(type: RunAntScript, dependsOn: build_rcp_branding) {\n+task build_rcp(type: RunAntScript, dependsOn: build_rcp_branding) {\nscriptArgs = defaultScriptArgs\ndescription = \"Build RCP Distribution\"\nscriptClasspath = buildScriptClasspath\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
Run RCP build on travis
426,496
09.08.2019 14:04:31
-7,200
fb702d105626f79f78c6c4adc6c36d89c5cd7917
Fix artifacts location from the RCP build to the plugins build
[ { "change_type": "MODIFY", "old_path": "mps/de.q60.mps.web.build.rcp/models/de.q60.mps.web.build.rcp.mps", "new_path": "mps/de.q60.mps.web.build.rcp/models/de.q60.mps.web.build.rcp.mps", "diff": "</node>\n<node concept=\"2sgV4H\" id=\"1_iojA27s_8\" role=\"1l3spa\">\n<ref role=\"1l3spb\" to=\"indb:7gF2HTviNP8\" resolve=\"de.q60.mps.web\" />\n+ <node concept=\"398BVA\" id=\"3$7Kuaikjyp\" role=\"2JcizS\">\n+ <ref role=\"398BVh\" node=\"7gF2HTvk5zJ\" resolve=\"webmps.home\" />\n+ <node concept=\"2Ry0Ak\" id=\"3$7Kuaikjyt\" role=\"iGT6I\">\n+ <property role=\"2Ry0Am\" value=\"build\" />\n+ <node concept=\"2Ry0Ak\" id=\"3$7Kuaikjyy\" role=\"2Ry0An\">\n+ <property role=\"2Ry0Am\" value=\"de.q60.mps.web\" />\n+ <node concept=\"2Ry0Ak\" id=\"3$7KuaikjyB\" role=\"2Ry0An\">\n+ <property role=\"2Ry0Am\" value=\"build\" />\n+ <node concept=\"2Ry0Ak\" id=\"3$7KuaikjyG\" role=\"2Ry0An\">\n+ <property role=\"2Ry0Am\" value=\"artifacts\" />\n+ <node concept=\"2Ry0Ak\" id=\"3$7KuaikjyL\" role=\"2Ry0An\">\n+ <property role=\"2Ry0Am\" value=\"de.q60.mps.web\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n</node>\n<node concept=\"3jsGME\" id=\"1_iojA26H3k\" role=\"3989C9\">\n<property role=\"TrG5h\" value=\"mps-tips\" />\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
Fix artifacts location from the RCP build to the plugins build
426,496
10.08.2019 13:27:18
-7,200
d21cbfe0dac3e8b6658f47015b89c91b36636484
Project for running a headless MPS on the server
[ { "change_type": "MODIFY", "old_path": ".gitignore", "new_path": ".gitignore", "diff": "@@ -7,3 +7,4 @@ mps/build/tmp\n.gradle\nartifacts\nbuild\n+ui-server/target\n" }, { "change_type": "ADD", "old_path": null, "new_path": "run-ui-server.sh", "diff": "+#!/bin/sh\n+\n+java -Dfile.encoding=UTF-8 -classpath \"./ui-server/target/webmps-ui-server-1.0-SNAPSHOT.jar:./build/de.q60.mps.web.rcp/build/artifacts/de.q60.mps.webDistribution/rcp/lib/*\" de.q60.mps.web.ui.server.Main\n" }, { "change_type": "ADD", "old_path": null, "new_path": "ui-server/.idea/.name", "diff": "+webmps-ui-server\n\\ No newline at end of file\n" }, { "change_type": "ADD", "old_path": null, "new_path": "ui-server/.idea/compiler.xml", "diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<project version=\"4\">\n+ <component name=\"CompilerConfiguration\">\n+ <annotationProcessing>\n+ <profile name=\"Maven default annotation processors profile\" enabled=\"true\">\n+ <sourceOutputDir name=\"target/generated-sources/annotations\" />\n+ <sourceTestOutputDir name=\"target/generated-test-sources/test-annotations\" />\n+ <outputRelativeToContentRoot value=\"true\" />\n+ <module name=\"ui-server\" />\n+ </profile>\n+ </annotationProcessing>\n+ </component>\n+</project>\n\\ No newline at end of file\n" }, { "change_type": "ADD", "old_path": null, "new_path": "ui-server/.idea/libraries/mps.xml", "diff": "+<component name=\"libraryTable\">\n+ <library name=\"mps\">\n+ <CLASSES>\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/annotations.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/asm-all-7.0.1.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/automaton-1.12-1.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/batik-all-1.10.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/bcprov-jdk15on-1.60.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/bootstrap.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/cglib-nodep-3.2.4.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/cli-parser-1.1.2.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/common-image-3.4.1.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/common-io-3.4.1.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/common-lang-3.4.1.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/commons-codec-1.10.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/commons-collections-3.2.2.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/commons-compress-1.18.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/commons-httpclient-3.1-patched.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/commons-imaging-1.0-RC-1.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/commons-lang-2.4.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/commons-logging-1.2.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/delight-rhino-sandbox-0.0.9.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/ecj-4.10.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/eddsa-0.2.0.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/error_prone_annotations-2.3.1.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/extensions.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/FastInfoset-1.2.15.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/fluent-hc-4.5.6.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/forms_rt.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/forms-1.1-preview.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/fst-2.57.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/groovy-all-2.4.15.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/gson-2.8.5.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/guava-25.1-jre.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/hamcrest-core-1.3.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/httpclient-4.5.6.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/httpcore-4.4.10.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/httpmime-4.5.6.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/idea_rt.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/imageio-core-3.4.1.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/imageio-metadata-3.4.1.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/imageio-tiff-3.4.1.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/imgscalr-lib-4.2.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/ini4j-0.5.5-2.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/intellij-coverage-agent-1.0.495.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/intellij-test-discovery-agent-1.0.495.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/isorelax-20030108.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/istack-commons-runtime-3.0.7.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/jackson-annotations-2.9.0.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/jackson-core-2.9.7.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/jackson-databind-2.9.7.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/java-api.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/java-compatibility-1.0.1.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/java-impl.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/javac2.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/javahelp-2.0.02.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/javassist-3.22.0-GA.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/javax.activation-1.2.0.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/javax.annotation-api-1.3.2.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/jaxb-api-2.3.1.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/jaxb-runtime-2.3.1.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/jaxen-1.1.6.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/jbcrypt-1.0.0.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/jcip-annotations-1.0.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/jdom.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/jediterm-pty-2.14.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/jetCheck-0.2.1.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/jing-20030619.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/jna-platform.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/jna.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/jps-model.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/jshell-frontend.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/junit-4.12.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/kotlin-reflect-1.3.11.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/kotlin-stdlib-1.3.11.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/kotlin-stdlib-jdk7-1.3.11.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/kotlin-stdlib-jdk8-1.3.11.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/kotlin-test-1.3.11.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/kotlinx-coroutines-core-1.0.1.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/kotlinx-coroutines-jdk8-1.0.1.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/log4j.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/lz4-1.3.0.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/microba.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/miglayout-core-5.2.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/miglayout-swing-5.2.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/mps-annotations.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/mps-behavior-api.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/mps-behavior-runtime.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/mps-boot-util.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/mps-boot.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/mps-closures.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/mps-collections.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/mps-core.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/mps-editor-api.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/mps-editor-runtime.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/mps-editor.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/mps-environment.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/mps-icons.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/mps-logging.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/mps-messaging.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/mps-openapi.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/mps-platform.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/mps-project-check.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/mps-references.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/mps-test.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/mps-tool.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/mps-tuples.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/mps-workbench.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/nanoxml-2.2.3.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/nekohtml-1.9.22.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/netty-buffer-4.1.32.Final.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/netty-codec-4.1.32.Final.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/netty-codec-http-4.1.32.Final.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/netty-common-4.1.32.Final.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/netty-handler-4.1.32.Final.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/netty-resolver-4.1.32.Final.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/netty-transport-4.1.32.Final.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/objenesis-2.6.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/openapi.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/oro-2.0.8.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/picocontainer-1.2.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/platform-api.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/platform-impl.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/platform.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/proxy-vole-1.0.6.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/pty4j-0.9.3.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/purejavacomm-0.0.11.1.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/rhino-1.7.10.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/rngom-20051226-patched.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/serviceMessages.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/slf4j-api-1.7.25.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/slf4j-log4j12-1.7.25.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/snakeyaml-1.23.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/stax-api-1.0.1.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/stax-ex-1.8.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/streamex-0.6.7.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/swingx-core-1.6.2-2.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/trang-core.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/trilead-ssh2-build-217-jenkins-11.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/trove4j.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/txw2-2.3.1.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/util.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/velocity-1.7.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/wadl-core.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/winp-1.28.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/xercesImpl-2.12.0.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/xml-apis-ext-1.3.04.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/xml-resolver-1.2.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/xmlbeans-2.6.0.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/xmlgraphics-commons-2.3.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/xmlpull-1.1.3.1.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/xmlrpc-2.0.1.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/xpp3_min-1.1.4c.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/xstream-1.4.10.jar!/\" />\n+ </CLASSES>\n+ <JAVADOC />\n+ <SOURCES>\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/delight-rhino-sandbox-0.0.9.jar!/\" />\n+ <root url=\"jar://$PROJECT_DIR$/../artifacts/mps/lib/MPS-src.zip!/\" />\n+ </SOURCES>\n+ </library>\n+</component>\n\\ No newline at end of file\n" }, { "change_type": "ADD", "old_path": null, "new_path": "ui-server/.idea/misc.xml", "diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<project version=\"4\">\n+ <component name=\"ExternalStorageConfigurationManager\" enabled=\"true\" />\n+ <component name=\"MavenProjectsManager\">\n+ <option name=\"originalFiles\">\n+ <list>\n+ <option value=\"$PROJECT_DIR$/pom.xml\" />\n+ </list>\n+ </option>\n+ </component>\n+ <component name=\"ProjectRootManager\" version=\"2\" languageLevel=\"JDK_1_8\" default=\"false\" project-jdk-name=\"1.8\" project-jdk-type=\"JavaSDK\">\n+ <output url=\"file://$PROJECT_DIR$/out\" />\n+ </component>\n+</project>\n\\ No newline at end of file\n" }, { "change_type": "ADD", "old_path": null, "new_path": "ui-server/.idea/vcs.xml", "diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<project version=\"4\">\n+ <component name=\"VcsDirectoryMappings\">\n+ <mapping directory=\"$PROJECT_DIR$/..\" vcs=\"Git\" />\n+ </component>\n+</project>\n\\ No newline at end of file\n" }, { "change_type": "ADD", "old_path": null, "new_path": "ui-server/pom.xml", "diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n+ xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n+ xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n+ <modelVersion>4.0.0</modelVersion>\n+\n+ <groupId>de.q60</groupId>\n+ <artifactId>webmps-ui-server</artifactId>\n+ <version>1.0-SNAPSHOT</version>\n+\n+ <properties>\n+ <maven.compiler.source>1.8</maven.compiler.source>\n+ <maven.compiler.target>1.8</maven.compiler.target>\n+ </properties>\n+\n+ <build>\n+ <plugins>\n+ <plugin>\n+ <groupId>com.googlecode.addjars-maven-plugin</groupId>\n+ <artifactId>addjars-maven-plugin</artifactId>\n+ <version>1.0.2</version>\n+ <executions>\n+ <execution>\n+ <goals>\n+ <goal>add-jars</goal>\n+ </goals>\n+ <configuration>\n+ <resources>\n+ <resource>\n+ <directory>${project.basedir}/../artifacts/mps/lib</directory>\n+ </resource>\n+ </resources>\n+ </configuration>\n+ </execution>\n+ </executions>\n+ </plugin>\n+ </plugins>\n+ </build>\n+\n+</project>\n\\ No newline at end of file\n" }, { "change_type": "ADD", "old_path": null, "new_path": "ui-server/src/main/java/de/q60/mps/web/ui/server/EnvironmentLoader.java", "diff": "+package de.q60.mps.web.ui.server;\n+\n+import com.intellij.util.ReflectionUtil;\n+import jetbrains.mps.project.Project;\n+import jetbrains.mps.tool.environment.Environment;\n+import jetbrains.mps.tool.environment.EnvironmentConfig;\n+import jetbrains.mps.tool.environment.IdeaEnvironment;\n+import jetbrains.mps.util.PathManager;\n+\n+import java.io.File;\n+\n+public class EnvironmentLoader {\n+\n+ private static Environment environment;\n+ private static Project ourProject;\n+\n+ public static void loadEnvironment(Project project) {\n+ if (ourProject != null) return;\n+ ourProject = project;\n+ }\n+\n+ public static Project loadEnvironment() {\n+ if (ourProject == null) {\n+ // If you get the exception \"Could not find installation home path\"\n+ // Set \"-Didea.home\" in the VM options\n+\n+ ReflectionUtil.setField(PathManager.class, null, String.class, \"ourHomePath\", System.getProperty(\"idea.home\"));\n+ ReflectionUtil.setField(PathManager.class, null, String.class, \"ourIdeaPath\", System.getProperty(\"idea.home\"));\n+\n+ EnvironmentConfig config = EnvironmentConfig.defaultConfig()\n+ .withBootstrapLibraries()\n+ .withBuildPlugin()\n+ .withCorePlugin()\n+ .withDefaultPlugins()\n+ .withDefaultSamples()\n+ //.withDevkitPlugin()\n+ .withGit4IdeaPlugin()\n+ .withJavaPlugin()\n+ //.withMakePlugin()\n+ .withMigrationPlugin()\n+ //.withTestingPlugin()\n+ .withVcsPlugin()\n+ .withWorkbenchPath()\n+ //.addMacro(\"extensions.home\", new File(\"/Users/slisson/mps/mps191/MPS-Extensions\"))\n+ ;\n+ File homePath = new File(jetbrains.mps.util.PathManager.getHomePath());\n+ loadLangJars(config, new File(homePath,\"languages\"));\n+ loadLangJars(config, new File(homePath,\"plugins\"));\n+ environment = new IdeaEnvironment(config);\n+ ((IdeaEnvironment) environment).init();\n+ ourProject = environment.createEmptyProject();\n+\n+ // Use DefaultModelAccess to remove the need of undoable commands executed in EDT\n+ /*\n+ ModelAccess ma = ModelAccess.instance();\n+ if (ma instanceof WorkbenchModelAccess) {\n+ ((WorkbenchModelAccess) ma).disposeComponent();\n+ }\n+ UndoHelper.getInstance().setUndoHandler(new DefaultUndoHandler());\n+ */\n+\n+ }\n+\n+ return ourProject;\n+ }\n+\n+ static {\n+\n+ }\n+\n+ protected static void loadLangJars(EnvironmentConfig config, File folder) {\n+ if (!folder.exists()) return;\n+ if (folder.isFile()) {\n+ if (folder.getName().toLowerCase().endsWith(\".jar\")) {\n+ config.addLib(folder.getAbsolutePath());\n+ }\n+ } else {\n+ for (File subfolder : folder.listFiles()) {\n+ loadLangJars(config, subfolder);\n+ }\n+ }\n+ }\n+\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "ui-server/src/main/java/de/q60/mps/web/ui/server/Main.java", "diff": "+package de.q60.mps.web.ui.server;\n+\n+public class Main {\n+ public static void main(String[] args) {\n+ EnvironmentLoader.loadEnvironment();\n+ }\n+}\n+\n" }, { "change_type": "ADD", "old_path": null, "new_path": "ui-server/ui-server.iml", "diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<module type=\"JAVA_MODULE\" version=\"4\" />\n\\ No newline at end of file\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
Project for running a headless MPS on the server
426,496
10.08.2019 13:57:25
-7,200
d474cff5b7c4bfd0ac4b01db0831b10189eeafce
Add ui-server to the main build script
[ { "change_type": "MODIFY", "old_path": ".travis.yml", "new_path": ".travis.yml", "diff": "@@ -4,7 +4,7 @@ install: true\njdk: openjdk8\nscript:\n- - ./gradlew build_languages build_rcp\n+ - ./gradlew\ncache:\ndirectories:\n" }, { "change_type": "MODIFY", "old_path": "build.gradle", "new_path": "build.gradle", "diff": "@@ -13,11 +13,15 @@ buildscript {\nclasspath 'de.itemis.mps:mps-gradle-plugin:1.0.+'\n}\n}\n+plugins {\n+ id \"com.github.dkorotych.gradle-maven-exec\" version \"2.2\"\n+}\n+\ngroup 'de.q60.mps.web'\ndescription = \"Cloud storage and web UI for MPS\"\n-defaultTasks 'build_languages'\n+defaultTasks 'build_languages', 'build_rcp', 'build_ui_server'\nFile scriptFile(String relativePath) {\nnew File(\"$rootDir/build/$relativePath\")\n@@ -141,7 +145,7 @@ task build_rcp_branding(type: BuildLanguages, dependsOn: [allScripts, resolveMps\nscript new File(\"$rootDir/build/de.q60.mps.web.rcp/build-branding.xml\")\n}\n-task build_rcp(type: RunAntScript, dependsOn: build_rcp_branding) {\n+task build_rcp(type: RunAntScript, dependsOn: [build_rcp_branding]) {\nscriptArgs = defaultScriptArgs\ndescription = \"Build RCP Distribution\"\nscriptClasspath = buildScriptClasspath\n@@ -154,3 +158,10 @@ task run_tests(type: TestLanguages, dependsOn: build_languages) {\nscriptClasspath = buildScriptClasspath\nscript new File(\"$rootDir/mps/build-tests.xml\")\n}\n+\n+task build_ui_server(dependsOn: [build_rcp]) {\n+ mavenexec {\n+ workingDir file(\"$rootDir/ui-server\")\n+ goals 'package'\n+ }\n+}\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
Add ui-server to the main build script
426,496
10.08.2019 14:28:18
-7,200
519a86dad7d3dda22ce8eb9daa1253bd473d58a4
Add ui-server to the main build script (2)
[ { "change_type": "MODIFY", "old_path": "build.gradle", "new_path": "build.gradle", "diff": "@@ -160,8 +160,10 @@ task run_tests(type: TestLanguages, dependsOn: build_languages) {\n}\ntask build_ui_server(dependsOn: [build_rcp]) {\n+ doLast {\nmavenexec {\nworkingDir file(\"$rootDir/ui-server\")\ngoals 'package'\n}\n}\n+}\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
Add ui-server to the main build script (2)
426,496
10.08.2019 15:06:32
-7,200
eeb84088bbd40092a7ae153d600b0146113d5a25
Make die UI server working on a linux server
[ { "change_type": "MODIFY", "old_path": "mps/de.q60.mps.web.build.rcp/models/de.q60.mps.web.build.rcp.mps", "new_path": "mps/de.q60.mps.web.build.rcp/models/de.q60.mps.web.build.rcp.mps", "diff": "<ref role=\"1l3spb\" node=\"1_iojA26H1u\" resolve=\"de.q60.mps.webBranding\" />\n</node>\n<node concept=\"1l3spV\" id=\"1_iojA26HaE\" role=\"1l3spN\">\n+ <node concept=\"398223\" id=\"3LgA8d6QxFo\" role=\"39821P\">\n+ <node concept=\"3ygNvl\" id=\"3LgA8d6QxJ1\" role=\"39821P\">\n+ <ref role=\"3ygNvj\" node=\"1_iojA26H3m\" />\n+ </node>\n+ <node concept=\"3_J27D\" id=\"3LgA8d6QxFq\" role=\"Nbhlr\">\n+ <node concept=\"3Mxwew\" id=\"3LgA8d6QxIZ\" role=\"3MwsjC\">\n+ <property role=\"3MwjfP\" value=\"rcp\" />\n+ </node>\n+ </node>\n+ </node>\n<node concept=\"1tmT9g\" id=\"1_iojA26HbN\" role=\"39821P\">\n<property role=\"AB_bT\" value=\"gzip\" />\n<node concept=\"3ygNvl\" id=\"1_iojA26HbO\" role=\"39821P\">\n" }, { "change_type": "MODIFY", "old_path": "mps/de.q60.mps.web.ui.svg/models/de.q60.mps.web.ui.svg.plugin.mps", "new_path": "mps/de.q60.mps.web.ui.svg/models/de.q60.mps.web.ui.svg.plugin.mps", "diff": "</node>\n</node>\n</node>\n- <node concept=\"312cEg\" id=\"1LwnBM2YYW6\" role=\"jymVt\">\n- <property role=\"TrG5h\" value=\"window\" />\n- <node concept=\"3Tm6S6\" id=\"1LwnBM2YYW7\" role=\"1B3o_S\" />\n- <node concept=\"3uibUv\" id=\"1LwnBM2Z3h3\" role=\"1tU5fm\">\n- <ref role=\"3uigEE\" to=\"dxuu:~JWindow\" resolve=\"JWindow\" />\n- </node>\n- <node concept=\"2ShNRf\" id=\"1LwnBM2Z2Ok\" role=\"33vP2m\">\n- <node concept=\"YeOm9\" id=\"1LwnBM2ZB9l\" role=\"2ShVmc\">\n- <node concept=\"1Y3b0j\" id=\"1LwnBM2ZB9o\" role=\"YeSDq\">\n- <property role=\"2bfB8j\" value=\"true\" />\n- <ref role=\"1Y3XeK\" to=\"dxuu:~JWindow\" resolve=\"JWindow\" />\n- <ref role=\"37wK5l\" to=\"dxuu:~JWindow.&lt;init&gt;()\" resolve=\"JWindow\" />\n- <node concept=\"3Tm1VV\" id=\"1LwnBM2ZB9p\" role=\"1B3o_S\" />\n- <node concept=\"3clFb_\" id=\"1LwnBM2ZByd\" role=\"jymVt\">\n- <property role=\"1EzhhJ\" value=\"false\" />\n- <property role=\"TrG5h\" value=\"isShowing\" />\n- <property role=\"DiZV1\" value=\"false\" />\n- <property role=\"od$2w\" value=\"false\" />\n- <node concept=\"3Tm1VV\" id=\"1LwnBM2ZBye\" role=\"1B3o_S\" />\n- <node concept=\"10P_77\" id=\"1LwnBM2ZByg\" role=\"3clF45\" />\n- <node concept=\"3clFbS\" id=\"1LwnBM2ZBym\" role=\"3clF47\">\n- <node concept=\"3clFbF\" id=\"1LwnBM2ZDPA\" role=\"3cqZAp\">\n- <node concept=\"3clFbT\" id=\"1LwnBM2ZDP_\" role=\"3clFbG\">\n- <property role=\"3clFbU\" value=\"true\" />\n- </node>\n- </node>\n- </node>\n- <node concept=\"2AHcQZ\" id=\"1LwnBM2ZByn\" role=\"2AJF6D\">\n- <ref role=\"2AI5Lk\" to=\"wyt6:~Override\" resolve=\"Override\" />\n- </node>\n- </node>\n- </node>\n- </node>\n- </node>\n- </node>\n<node concept=\"312cEg\" id=\"1oBrsEKQfrF\" role=\"jymVt\">\n<property role=\"TrG5h\" value=\"highlighter\" />\n<property role=\"3TUv4t\" value=\"false\" />\n<ref role=\"37wK5l\" to=\"exr9:~EditorComponent.update()\" resolve=\"update\" />\n</node>\n</node>\n- <node concept=\"3clFbF\" id=\"1LwnBM2Zfgj\" role=\"3cqZAp\">\n- <node concept=\"2OqwBi\" id=\"1LwnBM2Zj_p\" role=\"3clFbG\">\n- <node concept=\"2OqwBi\" id=\"1LwnBM2ZgQG\" role=\"2Oq$k0\">\n- <node concept=\"37vLTw\" id=\"1LwnBM2Zfgh\" role=\"2Oq$k0\">\n- <ref role=\"3cqZAo\" node=\"1LwnBM2YYW6\" resolve=\"window\" />\n- </node>\n- <node concept=\"liA8E\" id=\"1LwnBM2Zj8o\" role=\"2OqNvi\">\n- <ref role=\"37wK5l\" to=\"dxuu:~JWindow.getContentPane()\" resolve=\"getContentPane\" />\n- </node>\n- </node>\n- <node concept=\"liA8E\" id=\"1LwnBM2Zlto\" role=\"2OqNvi\">\n- <ref role=\"37wK5l\" to=\"z60i:~Container.add(java.awt.Component)\" resolve=\"add\" />\n- <node concept=\"Xjq3P\" id=\"1LwnBM2ZmH5\" role=\"37wK5m\" />\n- </node>\n- </node>\n- </node>\n<node concept=\"3clFbF\" id=\"1oBrsEKQgjg\" role=\"3cqZAp\">\n<node concept=\"37vLTI\" id=\"1oBrsEKQgji\" role=\"3clFbG\">\n<node concept=\"2OqwBi\" id=\"1oBrsEKQaSO\" role=\"37vLTx\">\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
Make die UI server working on a linux server
426,496
12.08.2019 11:37:08
-7,200
b5bca153043433f022780d2571c4ddeb9fd5c4e7
Serve ui-client static files from MPS Use this URL to open the UI
[ { "change_type": "MODIFY", "old_path": ".gitignore", "new_path": ".gitignore", "diff": "@@ -8,3 +8,4 @@ mps/build/tmp\nartifacts\nbuild\nui-server/target\n+mps/de.q60.mps.web.ui.svg/lib/ui-client.jar\n" }, { "change_type": "MODIFY", "old_path": "build.gradle", "new_path": "build.gradle", "diff": "@@ -130,7 +130,7 @@ task allScripts(type: BuildLanguages, dependsOn: [resolveMps, resolveMpsArtifact\nscript new File(\"$rootDir/build-scripts.xml\")\n}\n-task build_languages(type: BuildLanguages, dependsOn: [allScripts, resolveMps, resolveMpsArtifacts]) {\n+task build_languages(type: BuildLanguages, dependsOn: [allScripts, resolveMps, resolveMpsArtifacts, packageNpmApp]) {\nscriptArgs = defaultScriptArgs\ndescription = \"Build all MPS language\"\nscriptClasspath = buildScriptClasspath\n" }, { "change_type": "MODIFY", "old_path": "mps/de.q60.mps.web.build/models/de.q60.mps.web.build.mps", "new_path": "mps/de.q60.mps.web.build/models/de.q60.mps.web.build.mps", "diff": "</node>\n</node>\n</node>\n+ <node concept=\"1SiIV0\" id=\"39ClI1HWjGC\" role=\"3bR37C\">\n+ <node concept=\"3bR9La\" id=\"39ClI1HWjGD\" role=\"1SiIV1\">\n+ <ref role=\"3bR37D\" to=\"ffeo:6pse5qHNhL7\" resolve=\"jetbrains.mps.ide.httpsupport.manager\" />\n+ </node>\n+ </node>\n+ <node concept=\"1SiIV0\" id=\"39ClI1HWjME\" role=\"3bR37C\">\n+ <node concept=\"1BurEX\" id=\"39ClI1HWjMF\" role=\"1SiIV1\">\n+ <node concept=\"398BVA\" id=\"39ClI1HWjMx\" role=\"1BurEY\">\n+ <ref role=\"398BVh\" node=\"3$7Kuaihl5X\" resolve=\"webmps.modules\" />\n+ <node concept=\"2Ry0Ak\" id=\"39ClI1HWjMy\" role=\"iGT6I\">\n+ <property role=\"2Ry0Am\" value=\"de.q60.mps.web.ui.svg\" />\n+ <node concept=\"2Ry0Ak\" id=\"39ClI1HWjMz\" role=\"2Ry0An\">\n+ <property role=\"2Ry0Am\" value=\"lib\" />\n+ <node concept=\"2Ry0Ak\" id=\"39ClI1HWjM$\" role=\"2Ry0An\">\n+ <property role=\"2Ry0Am\" value=\"ui-client.jar\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n</node>\n</node>\n<node concept=\"2G$12M\" id=\"7gF2HTviNPV\" role=\"3989C9\">\n" }, { "change_type": "MODIFY", "old_path": "mps/de.q60.mps.web.ui.svg/de.q60.mps.web.ui.svg.msd", "new_path": "mps/de.q60.mps.web.ui.svg/de.q60.mps.web.ui.svg.msd", "diff": "<stubModelEntry path=\"${module}/lib/json-20160810.jar\" />\n<stubModelEntry path=\"${module}/lib/gson-2.8.0.jar\" />\n<stubModelEntry path=\"${module}/lib/commons-codec-1.10.jar\" />\n+ <stubModelEntry path=\"${module}/lib/ui-client.jar\" />\n</stubModelEntries>\n<sourcePath />\n<dependencies>\n<dependency reexport=\"false\">6ed54515-acc8-4d1e-a16c-9fd6cfe951ea(MPS.Core)</dependency>\n<dependency reexport=\"false\">8865b7a8-5271-43d3-884c-6fd1d9cfdd34(MPS.OpenAPI)</dependency>\n<dependency reexport=\"false\">9a4afe51-f114-4595-b5df-048ce3c596be(jetbrains.mps.runtime)</dependency>\n+ <dependency reexport=\"false\">23865718-e2ed-41b5-a132-0da1d04e266d(jetbrains.mps.ide.httpsupport.manager)</dependency>\n</dependencies>\n<languageVersions>\n<language slang=\"l:f3061a53-9226-4cc5-a443-f952ceaf5816:jetbrains.mps.baseLanguage\" version=\"8\" />\n<language slang=\"l:f2801650-65d5-424e-bb1b-463a8781b786:jetbrains.mps.baseLanguage.javadoc\" version=\"2\" />\n<language slang=\"l:760a0a8c-eabb-4521-8bfd-65db761a9ba3:jetbrains.mps.baseLanguage.logging\" version=\"0\" />\n<language slang=\"l:a247e09e-2435-45ba-b8d2-07e93feba96a:jetbrains.mps.baseLanguage.tuples\" version=\"0\" />\n+ <language slang=\"l:817e4e70-961e-4a95-98a1-15e9f32231f1:jetbrains.mps.ide.httpsupport\" version=\"0\" />\n<language slang=\"l:63650c59-16c8-498a-99c8-005c7ee9515d:jetbrains.mps.lang.access\" version=\"0\" />\n<language slang=\"l:fe9d76d7-5809-45c9-ae28-a40915b4d6ff:jetbrains.mps.lang.checkedName\" version=\"0\" />\n<language slang=\"l:ceab5195-25ea-4f22-9b92-103b95ca8c0c:jetbrains.mps.lang.core\" version=\"1\" />\n<module reference=\"742f6602-5a2f-4313-aa6e-ae1cd4ffdc61(MPS.Platform)\" version=\"0\" />\n<module reference=\"cceec75f-de6e-4ee7-bd91-29a3a99bfede(de.q60.mps.web.ui.svg)\" version=\"0\" />\n<module reference=\"f0fff802-6d26-4d2e-b89d-391357265626(de.slisson.mps.hacks.editor)\" version=\"0\" />\n+ <module reference=\"23865718-e2ed-41b5-a132-0da1d04e266d(jetbrains.mps.ide.httpsupport.manager)\" version=\"0\" />\n<module reference=\"9a4afe51-f114-4595-b5df-048ce3c596be(jetbrains.mps.runtime)\" version=\"0\" />\n<module reference=\"b0f8641f-bd77-4421-8425-30d9088a82f7(org.apache.commons)\" version=\"0\" />\n</dependencyVersions>\n" }, { "change_type": "MODIFY", "old_path": "mps/de.q60.mps.web.ui.svg/models/de.q60.mps.web.ui.svg.plugin.mps", "new_path": "mps/de.q60.mps.web.ui.svg/models/de.q60.mps.web.ui.svg.plugin.mps", "diff": "<use id=\"ef7bf5ac-d06c-4342-b11d-e42104eb9343\" name=\"jetbrains.mps.lang.plugin.standalone\" version=\"0\" />\n<use id=\"63650c59-16c8-498a-99c8-005c7ee9515d\" name=\"jetbrains.mps.lang.access\" version=\"0\" />\n<use id=\"774bf8a0-62e5-41e1-af63-f4812e60e48b\" name=\"jetbrains.mps.baseLanguage.checkedDots\" version=\"0\" />\n+ <use id=\"817e4e70-961e-4a95-98a1-15e9f32231f1\" name=\"jetbrains.mps.ide.httpsupport\" version=\"0\" />\n<devkit ref=\"fbc25dd2-5da4-483a-8b19-70928e1b62d7(jetbrains.mps.devkit.general-purpose)\" />\n</languages>\n<imports>\n<import index=\"tqvn\" ref=\"6ed54515-acc8-4d1e-a16c-9fd6cfe951ea/java:jetbrains.mps.smodel.tempmodel(MPS.Core/)\" />\n<import index=\"w1kc\" ref=\"6ed54515-acc8-4d1e-a16c-9fd6cfe951ea/java:jetbrains.mps.smodel(MPS.Core/)\" />\n<import index=\"g3l6\" ref=\"6ed54515-acc8-4d1e-a16c-9fd6cfe951ea/java:jetbrains.mps.extapi.model(MPS.Core/)\" />\n+ <import index=\"3ju5\" ref=\"6ed54515-acc8-4d1e-a16c-9fd6cfe951ea/java:jetbrains.mps.vfs(MPS.Core/)\" />\n+ <import index=\"4h87\" ref=\"r:05ff02e5-9836-4ae9-a454-eab43fa58c8f(jetbrains.mps.ide.httpsupport.manager.plugin)\" />\n</imports>\n<registry>\n<language id=\"a247e09e-2435-45ba-b8d2-07e93feba96a\" name=\"jetbrains.mps.baseLanguage.tuples\">\n<concept id=\"540871147943773365\" name=\"jetbrains.mps.baseLanguage.collections.structure.SingleArgumentSequenceOperation\" flags=\"nn\" index=\"25WWJ4\">\n<child id=\"540871147943773366\" name=\"argument\" index=\"25WWJ7\" />\n</concept>\n+ <concept id=\"1172650591544\" name=\"jetbrains.mps.baseLanguage.collections.structure.SkipOperation\" flags=\"nn\" index=\"7r0gD\">\n+ <child id=\"1172658456740\" name=\"elementsToSkip\" index=\"7T0AP\" />\n+ </concept>\n<concept id=\"1226511727824\" name=\"jetbrains.mps.baseLanguage.collections.structure.SetType\" flags=\"in\" index=\"2hMVRd\">\n<child id=\"1226511765987\" name=\"elementType\" index=\"2hN53Y\" />\n</concept>\n<concept id=\"1167380149909\" name=\"jetbrains.mps.baseLanguage.collections.structure.RemoveElementOperation\" flags=\"nn\" index=\"3dhRuq\" />\n<concept id=\"1201792049884\" name=\"jetbrains.mps.baseLanguage.collections.structure.TranslateOperation\" flags=\"nn\" index=\"3goQfb\" />\n<concept id=\"1165525191778\" name=\"jetbrains.mps.baseLanguage.collections.structure.GetFirstOperation\" flags=\"nn\" index=\"1uHKPH\" />\n+ <concept id=\"1240687580870\" name=\"jetbrains.mps.baseLanguage.collections.structure.JoinOperation\" flags=\"nn\" index=\"3uJxvA\">\n+ <child id=\"1240687658305\" name=\"delimiter\" index=\"3uJOhx\" />\n+ </concept>\n<concept id=\"1165530316231\" name=\"jetbrains.mps.baseLanguage.collections.structure.IsEmptyOperation\" flags=\"nn\" index=\"1v1jN8\" />\n<concept id=\"1202120902084\" name=\"jetbrains.mps.baseLanguage.collections.structure.WhereOperation\" flags=\"nn\" index=\"3zZkjj\" />\n<concept id=\"1184963466173\" name=\"jetbrains.mps.baseLanguage.collections.structure.ToArrayOperation\" flags=\"nn\" index=\"3_kTaI\" />\n</language>\n+ <language id=\"817e4e70-961e-4a95-98a1-15e9f32231f1\" name=\"jetbrains.mps.ide.httpsupport\">\n+ <concept id=\"5573986434797682998\" name=\"jetbrains.mps.ide.httpsupport.structure.HandleRequestFunction\" flags=\"ig\" index=\"pF8on\" />\n+ <concept id=\"5573986434797765074\" name=\"jetbrains.mps.ide.httpsupport.structure.HttpRequestParameter\" flags=\"ng\" index=\"pFkrN\" />\n+ <concept id=\"5573986434797590400\" name=\"jetbrains.mps.ide.httpsupport.structure.RequestHandler\" flags=\"ng\" index=\"pFx2x\">\n+ <child id=\"5573986434797811183\" name=\"handleFunction\" index=\"pCJbe\" />\n+ <child id=\"6040064942661848825\" name=\"queryPrefix\" index=\"std7D\" />\n+ </concept>\n+ <concept id=\"6040064942661848791\" name=\"jetbrains.mps.ide.httpsupport.structure.QueryPath\" flags=\"ng\" index=\"std77\">\n+ <child id=\"6040064942661848818\" name=\"segmetns\" index=\"std7y\" />\n+ </concept>\n+ <concept id=\"6040064942661848792\" name=\"jetbrains.mps.ide.httpsupport.structure.QuerySegment\" flags=\"ng\" index=\"std78\">\n+ <property id=\"6040064942662280271\" name=\"segment\" index=\"svBHv\" />\n+ </concept>\n+ <concept id=\"6886330673564897217\" name=\"jetbrains.mps.ide.httpsupport.structure.ResponseSendOperation\" flags=\"ng\" index=\"1W9Qq2\">\n+ <property id=\"6886330673564897341\" name=\"type\" index=\"1W9R_Y\" />\n+ <child id=\"6886330673564897343\" name=\"buffer\" index=\"1W9R_W\" />\n+ </concept>\n+ </language>\n</registry>\n<node concept=\"2DaZZR\" id=\"6xm2RBl6fwx\" />\n<node concept=\"sE7Ow\" id=\"6xm2RBl6fwy\">\n</node>\n</node>\n</node>\n+ <node concept=\"pFx2x\" id=\"AkkmJBO8Zi\">\n+ <property role=\"TrG5h\" value=\"Static\" />\n+ <node concept=\"std77\" id=\"AkkmJBO8Zj\" role=\"std7D\">\n+ <node concept=\"std78\" id=\"AkkmJBO8Zk\" role=\"std7y\">\n+ <property role=\"svBHv\" value=\"webmps-ui-svg-static\" />\n+ </node>\n+ </node>\n+ <node concept=\"pF8on\" id=\"AkkmJBO8Zl\" role=\"pCJbe\">\n+ <node concept=\"3clFbS\" id=\"AkkmJBO8Zm\" role=\"2VODD2\">\n+ <node concept=\"3cpWs8\" id=\"39ClI1HVqv_\" role=\"3cqZAp\">\n+ <node concept=\"3cpWsn\" id=\"39ClI1HVqvA\" role=\"3cpWs9\">\n+ <property role=\"TrG5h\" value=\"fileName\" />\n+ <node concept=\"17QB3L\" id=\"39ClI1HVqM_\" role=\"1tU5fm\" />\n+ <node concept=\"2OqwBi\" id=\"39ClI1HVWsY\" role=\"33vP2m\">\n+ <node concept=\"2OqwBi\" id=\"39ClI1HVWsZ\" role=\"2Oq$k0\">\n+ <node concept=\"2OqwBi\" id=\"39ClI1HVWt0\" role=\"2Oq$k0\">\n+ <node concept=\"pFkrN\" id=\"39ClI1HVWt1\" role=\"2Oq$k0\" />\n+ <node concept=\"liA8E\" id=\"39ClI1HVWt2\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" to=\"4h87:1Hl7x1atdjC\" resolve=\"getSegments\" />\n+ </node>\n+ </node>\n+ <node concept=\"7r0gD\" id=\"39ClI1HVWt3\" role=\"2OqNvi\">\n+ <node concept=\"3cmrfG\" id=\"39ClI1HVWt4\" role=\"7T0AP\">\n+ <property role=\"3cmrfH\" value=\"1\" />\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3uJxvA\" id=\"39ClI1HVWt5\" role=\"2OqNvi\">\n+ <node concept=\"Xl_RD\" id=\"39ClI1HVWt6\" role=\"3uJOhx\">\n+ <property role=\"Xl_RC\" value=\"/\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3cpWs8\" id=\"39ClI1HUZ21\" role=\"3cqZAp\">\n+ <node concept=\"3cpWsn\" id=\"39ClI1HUZ22\" role=\"3cpWs9\">\n+ <property role=\"TrG5h\" value=\"stream\" />\n+ <node concept=\"3uibUv\" id=\"39ClI1HUZ1Q\" role=\"1tU5fm\">\n+ <ref role=\"3uigEE\" to=\"guwi:~InputStream\" resolve=\"InputStream\" />\n+ </node>\n+ <node concept=\"2OqwBi\" id=\"39ClI1HWcfC\" role=\"33vP2m\">\n+ <node concept=\"2OqwBi\" id=\"39ClI1HWcfD\" role=\"2Oq$k0\">\n+ <node concept=\"2OqwBi\" id=\"39ClI1HWcfE\" role=\"2Oq$k0\">\n+ <node concept=\"2ShNRf\" id=\"39ClI1HWcfF\" role=\"2Oq$k0\">\n+ <node concept=\"YeOm9\" id=\"39ClI1HWcfG\" role=\"2ShVmc\">\n+ <node concept=\"1Y3b0j\" id=\"39ClI1HWcfH\" role=\"YeSDq\">\n+ <property role=\"2bfB8j\" value=\"true\" />\n+ <ref role=\"37wK5l\" to=\"wyt6:~Object.&lt;init&gt;()\" resolve=\"Object\" />\n+ <ref role=\"1Y3XeK\" to=\"wyt6:~Object\" resolve=\"Object\" />\n+ <node concept=\"3Tm1VV\" id=\"39ClI1HWcfI\" role=\"1B3o_S\" />\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"liA8E\" id=\"39ClI1HWcfJ\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" to=\"wyt6:~Object.getClass()\" resolve=\"getClass\" />\n+ </node>\n+ </node>\n+ <node concept=\"liA8E\" id=\"39ClI1HWcfK\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" to=\"wyt6:~Class.getClassLoader()\" resolve=\"getClassLoader\" />\n+ </node>\n+ </node>\n+ <node concept=\"liA8E\" id=\"39ClI1HWcfL\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" to=\"wyt6:~ClassLoader.getResourceAsStream(java.lang.String)\" resolve=\"getResourceAsStream\" />\n+ <node concept=\"3cpWs3\" id=\"39ClI1HWcfM\" role=\"37wK5m\">\n+ <node concept=\"37vLTw\" id=\"39ClI1HWcfN\" role=\"3uHU7w\">\n+ <ref role=\"3cqZAo\" node=\"39ClI1HVqvA\" resolve=\"fileName\" />\n+ </node>\n+ <node concept=\"Xl_RD\" id=\"39ClI1HWcfO\" role=\"3uHU7B\">\n+ <property role=\"Xl_RC\" value=\"de/q60/mps/web/ui/svg/client/static/\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3cpWs8\" id=\"39ClI1HUy6D\" role=\"3cqZAp\">\n+ <node concept=\"3cpWsn\" id=\"39ClI1HUy6E\" role=\"3cpWs9\">\n+ <property role=\"TrG5h\" value=\"content\" />\n+ <node concept=\"17QB3L\" id=\"39ClI1HUywr\" role=\"1tU5fm\" />\n+ </node>\n+ </node>\n+ <node concept=\"2GUZhq\" id=\"39ClI1HV6OJ\" role=\"3cqZAp\">\n+ <node concept=\"3clFbS\" id=\"39ClI1HV6OL\" role=\"2GV8ay\">\n+ <node concept=\"3clFbF\" id=\"39ClI1HV9kD\" role=\"3cqZAp\">\n+ <node concept=\"37vLTI\" id=\"39ClI1HV9kF\" role=\"3clFbG\">\n+ <node concept=\"2YIFZM\" id=\"39ClI1HV36R\" role=\"37vLTx\">\n+ <ref role=\"1Pybhc\" to=\"8oaq:~IOUtils\" resolve=\"IOUtils\" />\n+ <ref role=\"37wK5l\" to=\"8oaq:~IOUtils.toString(java.io.InputStream)\" resolve=\"toString\" />\n+ <node concept=\"37vLTw\" id=\"39ClI1HV36S\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"39ClI1HUZ22\" resolve=\"stream\" />\n+ </node>\n+ </node>\n+ <node concept=\"37vLTw\" id=\"39ClI1HV9kJ\" role=\"37vLTJ\">\n+ <ref role=\"3cqZAo\" node=\"39ClI1HUy6E\" resolve=\"content\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3clFbS\" id=\"39ClI1HV6OM\" role=\"2GVbov\">\n+ <node concept=\"3clFbF\" id=\"39ClI1HV4D5\" role=\"3cqZAp\">\n+ <node concept=\"2YIFZM\" id=\"39ClI1HV4U2\" role=\"3clFbG\">\n+ <ref role=\"1Pybhc\" to=\"8oaq:~IOUtils\" resolve=\"IOUtils\" />\n+ <ref role=\"37wK5l\" to=\"8oaq:~IOUtils.closeQuietly(java.io.InputStream)\" resolve=\"closeQuietly\" />\n+ <node concept=\"37vLTw\" id=\"39ClI1HV59N\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"39ClI1HUZ22\" resolve=\"stream\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3clFbH\" id=\"39ClI1HV41b\" role=\"3cqZAp\" />\n+ <node concept=\"3clFbH\" id=\"39ClI1HUyCB\" role=\"3cqZAp\" />\n+ <node concept=\"3clFbJ\" id=\"AkkmJC04o$\" role=\"3cqZAp\">\n+ <node concept=\"3clFbS\" id=\"AkkmJC04oA\" role=\"3clFbx\">\n+ <node concept=\"3clFbF\" id=\"AkkmJC0a9y\" role=\"3cqZAp\">\n+ <node concept=\"2OqwBi\" id=\"AkkmJC0a9z\" role=\"3clFbG\">\n+ <node concept=\"pFkrN\" id=\"AkkmJC0a9$\" role=\"2Oq$k0\" />\n+ <node concept=\"1W9Qq2\" id=\"AkkmJC0a9_\" role=\"2OqNvi\">\n+ <property role=\"1W9R_Y\" value=\"text/css\" />\n+ <node concept=\"37vLTw\" id=\"39ClI1HUy6H\" role=\"1W9R_W\">\n+ <ref role=\"3cqZAo\" node=\"39ClI1HUy6E\" resolve=\"content\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"2OqwBi\" id=\"AkkmJC07be\" role=\"3clFbw\">\n+ <node concept=\"37vLTw\" id=\"39ClI1HVrwh\" role=\"2Oq$k0\">\n+ <ref role=\"3cqZAo\" node=\"39ClI1HVqvA\" resolve=\"fileName\" />\n+ </node>\n+ <node concept=\"liA8E\" id=\"AkkmJC09Qg\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" to=\"wyt6:~String.endsWith(java.lang.String)\" resolve=\"endsWith\" />\n+ <node concept=\"Xl_RD\" id=\"AkkmJC09Rg\" role=\"37wK5m\">\n+ <property role=\"Xl_RC\" value=\".css\" />\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"9aQIb\" id=\"AkkmJC09Xj\" role=\"9aQIa\">\n+ <node concept=\"3clFbS\" id=\"AkkmJC09Xk\" role=\"9aQI4\">\n+ <node concept=\"3clFbF\" id=\"39ClI1HUzCG\" role=\"3cqZAp\">\n+ <node concept=\"2OqwBi\" id=\"39ClI1HUzCH\" role=\"3clFbG\">\n+ <node concept=\"pFkrN\" id=\"39ClI1HUzCI\" role=\"2Oq$k0\" />\n+ <node concept=\"1W9Qq2\" id=\"39ClI1HUzCJ\" role=\"2OqNvi\">\n+ <property role=\"1W9R_Y\" value=\"text/plain\" />\n+ <node concept=\"37vLTw\" id=\"39ClI1HUzCK\" role=\"1W9R_W\">\n+ <ref role=\"3cqZAo\" node=\"39ClI1HUy6E\" resolve=\"content\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3eNFk2\" id=\"39ClI1HTqtA\" role=\"3eNLev\">\n+ <node concept=\"3clFbS\" id=\"39ClI1HTqtC\" role=\"3eOfB_\">\n+ <node concept=\"3clFbF\" id=\"39ClI1HTr9c\" role=\"3cqZAp\">\n+ <node concept=\"2OqwBi\" id=\"39ClI1HTr9d\" role=\"3clFbG\">\n+ <node concept=\"pFkrN\" id=\"39ClI1HTr9e\" role=\"2Oq$k0\" />\n+ <node concept=\"1W9Qq2\" id=\"39ClI1HTr9f\" role=\"2OqNvi\">\n+ <property role=\"1W9R_Y\" value=\"text/html\" />\n+ <node concept=\"37vLTw\" id=\"39ClI1HUy6J\" role=\"1W9R_W\">\n+ <ref role=\"3cqZAo\" node=\"39ClI1HUy6E\" resolve=\"content\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"22lmx$\" id=\"39ClI1HTr2T\" role=\"3eO9$A\">\n+ <node concept=\"2OqwBi\" id=\"39ClI1HTqIg\" role=\"3uHU7B\">\n+ <node concept=\"37vLTw\" id=\"39ClI1HVrwy\" role=\"2Oq$k0\">\n+ <ref role=\"3cqZAo\" node=\"39ClI1HVqvA\" resolve=\"fileName\" />\n+ </node>\n+ <node concept=\"liA8E\" id=\"39ClI1HTqIk\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" to=\"wyt6:~String.endsWith(java.lang.String)\" resolve=\"endsWith\" />\n+ <node concept=\"Xl_RD\" id=\"39ClI1HTqIl\" role=\"37wK5m\">\n+ <property role=\"Xl_RC\" value=\".html\" />\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"2OqwBi\" id=\"39ClI1HTr5w\" role=\"3uHU7w\">\n+ <node concept=\"37vLTw\" id=\"39ClI1HVrvZ\" role=\"2Oq$k0\">\n+ <ref role=\"3cqZAo\" node=\"39ClI1HVqvA\" resolve=\"fileName\" />\n+ </node>\n+ <node concept=\"liA8E\" id=\"39ClI1HTr5$\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" to=\"wyt6:~String.endsWith(java.lang.String)\" resolve=\"endsWith\" />\n+ <node concept=\"Xl_RD\" id=\"39ClI1HTr5_\" role=\"37wK5m\">\n+ <property role=\"Xl_RC\" value=\".htm\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3eNFk2\" id=\"39ClI1HUz1U\" role=\"3eNLev\">\n+ <node concept=\"3clFbS\" id=\"39ClI1HUz1W\" role=\"3eOfB_\">\n+ <node concept=\"3clFbF\" id=\"AkkmJBO90l\" role=\"3cqZAp\">\n+ <node concept=\"2OqwBi\" id=\"AkkmJBO90m\" role=\"3clFbG\">\n+ <node concept=\"pFkrN\" id=\"AkkmJBO90n\" role=\"2Oq$k0\" />\n+ <node concept=\"1W9Qq2\" id=\"AkkmJBO90o\" role=\"2OqNvi\">\n+ <property role=\"1W9R_Y\" value=\"text/javascript\" />\n+ <node concept=\"37vLTw\" id=\"39ClI1HUy6I\" role=\"1W9R_W\">\n+ <ref role=\"3cqZAo\" node=\"39ClI1HUy6E\" resolve=\"content\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"2OqwBi\" id=\"39ClI1HUz$Y\" role=\"3eO9$A\">\n+ <node concept=\"37vLTw\" id=\"39ClI1HVrw8\" role=\"2Oq$k0\">\n+ <ref role=\"3cqZAo\" node=\"39ClI1HVqvA\" resolve=\"fileName\" />\n+ </node>\n+ <node concept=\"liA8E\" id=\"39ClI1HUz_0\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" to=\"wyt6:~String.endsWith(java.lang.String)\" resolve=\"endsWith\" />\n+ <node concept=\"Xl_RD\" id=\"39ClI1HUz_1\" role=\"37wK5m\">\n+ <property role=\"Xl_RC\" value=\".js\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n</model>\n" }, { "change_type": "MODIFY", "old_path": "ui-client/build.gradle", "new_path": "ui-client/build.gradle", "diff": "@@ -48,12 +48,12 @@ npm_run_build {\n// pack output of the build into JAR file\ntask packageNpmApp(type: Zip) {\ndependsOn npm_run_build\n- baseName 'npm-app'\n+ baseName 'ui-client'\nextension 'jar'\n- destinationDir file(\"${projectDir}/build_packageNpmApp\")\n+ destinationDir file(\"${projectDir}/../mps/de.q60.mps.web.ui.svg/lib/\")\nfrom('dist') {\n// optional path under which output will be visible in Java classpath, e.g. static resources path\n- into 'static'\n+ into 'de/q60/mps/web/ui/svg/client/static'\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "ui-client/src/scripts/app.ts", "new_path": "ui-client/src/scripts/app.ts", "diff": "import \"../styles/base.scss\";\nimport $ = require(\"jquery\");\n-//import * as react from \"react-dom\";\nimport {JSKeyCodes, KeyCodeTranslator} from \"./KeyCodeTranslator\";\nlet viewer1 = document.getElementById(\"viewer1\");\n@@ -8,7 +7,7 @@ viewer1.tabIndex = -1;\nlet lastEventTime: number = 0;\n-const socket = new WebSocket(\"ws://sl-svr2:8391/\");\n+const socket = new WebSocket(\"ws://\" + window.location.hostname + \":8391/\");\nlet rawDataFollowing: boolean = false;\nlet lastMessage: IMessage = null;\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
Serve ui-client static files from MPS Use this URL to open the UI http://127.0.0.1:63320/webmps-ui-svg-static/index.html
426,496
12.08.2019 14:19:23
-7,200
ab0f9be50f26eb7a85141b7bc14167c96d19568f
Adjust the URL to the model server
[ { "change_type": "MODIFY", "old_path": "mps/de.q60.mps.web.model.mpsplugin/models/de.q60.mps.web.model.mpsplugin.mps", "new_path": "mps/de.q60.mps.web.model.mpsplugin/models/de.q60.mps.web.model.mpsplugin.mps", "diff": "<node concept=\"1pGfFk\" id=\"3WN29Vk$1o7\" role=\"2ShVmc\">\n<ref role=\"37wK5l\" to=\"zf81:~URI.&lt;init&gt;(java.lang.String)\" resolve=\"URI\" />\n<node concept=\"Xl_RD\" id=\"3WN29Vk$1o8\" role=\"37wK5m\">\n- <property role=\"Xl_RC\" value=\"ws://webmps2.q60.de:80\" />\n- </node>\n- </node>\n- </node>\n- <node concept=\"2ShNRf\" id=\"3WN29Vk$2wx\" role=\"3g7hyw\">\n- <node concept=\"1pGfFk\" id=\"3WN29Vk$2wy\" role=\"2ShVmc\">\n- <ref role=\"37wK5l\" to=\"zf81:~URI.&lt;init&gt;(java.lang.String)\" resolve=\"URI\" />\n- <node concept=\"Xl_RD\" id=\"3WN29Vk$2wz\" role=\"37wK5m\">\n- <property role=\"Xl_RC\" value=\"ws://webmps.q60.de:80\" />\n+ <property role=\"Xl_RC\" value=\"ws://model.webmps.q60.de:80\" />\n</node>\n</node>\n</node>\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
Adjust the URL to the model server
426,496
12.08.2019 14:25:37
-7,200
bdb5c191b4179cf7c5caf425ea869d84b52fdbf5
Limit versions shown in the history view to 500
[ { "change_type": "MODIFY", "old_path": "mps/de.q60.mps.web.model.mpsplugin/models/de.q60.mps.web.model.mpsplugin.history.mps", "new_path": "mps/de.q60.mps.web.model.mpsplugin/models/de.q60.mps.web.model.mpsplugin.history.mps", "diff": "<child id=\"1068498886297\" name=\"rValue\" index=\"37vLTx\" />\n<child id=\"1068498886295\" name=\"lValue\" index=\"37vLTJ\" />\n</concept>\n+ <concept id=\"1153417849900\" name=\"jetbrains.mps.baseLanguage.structure.GreaterThanOrEqualsExpression\" flags=\"nn\" index=\"2d3UOw\" />\n<concept id=\"1153422305557\" name=\"jetbrains.mps.baseLanguage.structure.LessThanOrEqualsExpression\" flags=\"nn\" index=\"2dkUwp\" />\n<concept id=\"4836112446988635817\" name=\"jetbrains.mps.baseLanguage.structure.UndefinedType\" flags=\"in\" index=\"2jxLKc\" />\n<concept id=\"1202948039474\" name=\"jetbrains.mps.baseLanguage.structure.InstanceMethodCallOperation\" flags=\"nn\" index=\"liA8E\" />\n<child id=\"1081773367580\" name=\"leftExpression\" index=\"3uHU7B\" />\n</concept>\n<concept id=\"1073239437375\" name=\"jetbrains.mps.baseLanguage.structure.NotEqualsExpression\" flags=\"nn\" index=\"3y3z36\" />\n+ <concept id=\"1081855346303\" name=\"jetbrains.mps.baseLanguage.structure.BreakStatement\" flags=\"nn\" index=\"3zACq4\" />\n<concept id=\"1178549954367\" name=\"jetbrains.mps.baseLanguage.structure.IVisible\" flags=\"ng\" index=\"1B3ioH\">\n<child id=\"1178549979242\" name=\"visibility\" index=\"1B3o_S\" />\n</concept>\n</node>\n</node>\n</node>\n+ <node concept=\"3clFbJ\" id=\"308eh69uqFm\" role=\"3cqZAp\">\n+ <node concept=\"3clFbS\" id=\"308eh69uqFo\" role=\"3clFbx\">\n+ <node concept=\"3zACq4\" id=\"308eh69v3MK\" role=\"3cqZAp\" />\n+ </node>\n+ <node concept=\"2d3UOw\" id=\"308eh69v1KY\" role=\"3clFbw\">\n+ <node concept=\"3cmrfG\" id=\"308eh69v2ma\" role=\"3uHU7w\">\n+ <property role=\"3cmrfH\" value=\"500\" />\n+ </node>\n+ <node concept=\"2OqwBi\" id=\"308eh69utzc\" role=\"3uHU7B\">\n+ <node concept=\"37vLTw\" id=\"308eh69usfH\" role=\"2Oq$k0\">\n+ <ref role=\"3cqZAo\" node=\"5oJTJC87Dff\" resolve=\"versions\" />\n+ </node>\n+ <node concept=\"34oBXx\" id=\"308eh69uJsu\" role=\"2OqNvi\" />\n+ </node>\n+ </node>\n+ </node>\n<node concept=\"3clFbF\" id=\"2D0HTQhcXvE\" role=\"3cqZAp\">\n<node concept=\"37vLTI\" id=\"2D0HTQhcXvF\" role=\"3clFbG\">\n<node concept=\"37vLTw\" id=\"2D0HTQhcXvG\" role=\"37vLTJ\">\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
Limit versions shown in the history view to 500
426,496
12.08.2019 15:19:17
-7,200
11eba073955800047d63887a98450df30f315127
Adjust URL to ui-server
[ { "change_type": "MODIFY", "old_path": "ui-client/src/scripts/app.ts", "new_path": "ui-client/src/scripts/app.ts", "diff": "@@ -7,7 +7,7 @@ viewer1.tabIndex = -1;\nlet lastEventTime: number = 0;\n-const socket = new WebSocket(\"ws://\" + window.location.hostname + \":8391/\");\n+const socket = new WebSocket(\"ws://ui.webmps.q60.de:80/\");\nlet rawDataFollowing: boolean = false;\nlet lastMessage: IMessage = null;\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
Adjust URL to ui-server
426,496
12.08.2019 16:00:03
-7,200
25b7a26d3bb9174704212bcdeecb2d7f9e29d7a3
Apache 2 configuration
[ { "change_type": "ADD", "old_path": null, "new_path": "apache.conf", "diff": "+<VirtualHost *:80>\n+ ServerName model.webmps.q60.de\n+ ProxyRequests Off\n+ <Proxy *>\n+ Order deny,allow\n+ Allow from all\n+ </Proxy>\n+ ProxyPass / http://127.0.0.1:28101/\n+ ProxyPassReverse / http://127.0.0.1:28101/\n+\n+ RewriteEngine On\n+ RewriteCond %{HTTP:Upgrade} =websocket [NC]\n+ RewriteRule /(.*) ws://localhost:28101/$1 [P,L]\n+ RewriteCond %{HTTP:Upgrade} !=websocket [NC]\n+ RewriteRule /(.*) http://localhost:28101/$1 [P,L]\n+</VirtualHost>\n+\n+<VirtualHost *:80>\n+ ServerName ui.webmps.q60.de\n+ ProxyRequests Off\n+ <Proxy *>\n+ Order deny,allow\n+ Allow from all\n+ </Proxy>\n+ ProxyPass / http://127.0.0.1:8391/\n+ ProxyPassReverse / http://127.0.0.1:8391/\n+\n+ RewriteEngine On\n+ RewriteCond %{HTTP:Upgrade} =websocket [NC]\n+ RewriteRule /(.*) ws://localhost:8391/$1 [P,L]\n+ RewriteCond %{HTTP:Upgrade} !=websocket [NC]\n+ RewriteRule /(.*) http://localhost:8391/$1 [P,L]\n+</VirtualHost>\n+\n+<VirtualHost *:80>\n+ ServerName webmps.q60.de\n+ DocumentRoot /home/sascha/webmps/ui-client/dist\n+</VirtualHost>\n+\n+<VirtualHost *:80>\n+ ServerName static.webmps.q60.de\n+ DocumentRoot /home/sascha/webmps/ui-client/dist\n+</VirtualHost>\n+\n+<Directory /home/sascha/webmps/ui-client/dist>\n+ Require all granted\n+</Directory>\n+\n+# vim: syntax=apache ts=4 sw=4 sts=4 sr noet\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
Apache 2 configuration
426,496
13.08.2019 08:35:49
-7,200
acd938eeab68bf57f637110db68e14c8c73ea7cc
Remove TransientSModel/TransientSModule marker interfaces They disable auto quick fixes, which is necessary in shadow models, but not here.
[ { "change_type": "MODIFY", "old_path": "mps/de.q60.mps.web.model.mpsplugin/models/de.q60.mps.web.model.mpsplugin.mps", "new_path": "mps/de.q60.mps.web.model.mpsplugin/models/de.q60.mps.web.model.mpsplugin.mps", "diff": "</node>\n<node concept=\"2tJIrI\" id=\"7Zr9caIDD0a\" role=\"jymVt\" />\n<node concept=\"3Tm1VV\" id=\"4QZGLsLESlP\" role=\"1B3o_S\" />\n- <node concept=\"3uibUv\" id=\"3mxFqZU6ndJ\" role=\"EKbjA\">\n- <ref role=\"3uigEE\" to=\"g3l6:~TransientSModel\" resolve=\"TransientSModel\" />\n- </node>\n</node>\n<node concept=\"312cEu\" id=\"115Xaa43tZI\">\n<property role=\"TrG5h\" value=\"WebModule\" />\n<node concept=\"3Tm1VV\" id=\"115Xaa43u0B\" role=\"1B3o_S\" />\n<node concept=\"10P_77\" id=\"115Xaa43u0C\" role=\"3clF45\" />\n</node>\n- <node concept=\"3uibUv\" id=\"4QZGLsLHl24\" role=\"EKbjA\">\n- <ref role=\"3uigEE\" to=\"31cb:~TransientSModule\" resolve=\"TransientSModule\" />\n- </node>\n<node concept=\"3uibUv\" id=\"4j_LshTVCRE\" role=\"EKbjA\">\n<ref role=\"3uigEE\" to=\"pxvb:B8a55Urgn8\" resolve=\"IUserObjectContainer\" />\n</node>\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
Remove TransientSModel/TransientSModule marker interfaces They disable auto quick fixes, which is necessary in shadow models, but not here.
426,496
13.08.2019 15:57:48
-7,200
68f256e2c12e27a49a872a485182063be024880b
Rename de.q60.mps.shadowmodels.web.lib -> de.q60.mps.web.lib
[ { "change_type": "MODIFY", "old_path": "mps/.mps/modules.xml", "new_path": "mps/.mps/modules.xml", "diff": "<projectModules>\n<modulePath path=\"$PROJECT_DIR$/de.q60.mps.shadowmodels.web.dom/de.q60.mps.shadowmodels.web.dom.mpl\" folder=\"ui.shadowmodels\" />\n<modulePath path=\"$PROJECT_DIR$/de.q60.mps.shadowmodels.web.json/de.q60.mps.shadowmodels.web.json.mpl\" folder=\"ui.shadowmodels\" />\n- <modulePath path=\"$PROJECT_DIR$/de.q60.mps.shadowmodels.web.lib/de.q60.mps.shadowmodels.web.lib.msd\" folder=\"common\" />\n<modulePath path=\"$PROJECT_DIR$/de.q60.mps.shadowmodels.web.server/de.q60.mps.shadowmodels.web.server.msd\" folder=\"ui.shadowmodels\" />\n<modulePath path=\"$PROJECT_DIR$/de.q60.mps.shadowmodels.web.statemachine/de.q60.mps.shadowmodels.web.statemachine.mpl\" folder=\"ui.shadowmodels\" />\n<modulePath path=\"$PROJECT_DIR$/de.q60.mps.shadowmodels.web/de.q60.mps.shadowmodels.web.mpl\" folder=\"ui.shadowmodels\" />\n+ <modulePath path=\"$PROJECT_DIR$/de.q60.mps.web.build.rcp/de.q60.mps.web.build.rcp.msd\" folder=\"build\" />\n+ <modulePath path=\"$PROJECT_DIR$/de.q60.mps.web.build.scripts/de.q60.mps.web.build.scripts.msd\" folder=\"build\" />\n<modulePath path=\"$PROJECT_DIR$/de.q60.mps.web.build/de.q60.mps.web.build.msd\" folder=\"build\" />\n+ <modulePath path=\"$PROJECT_DIR$/de.q60.mps.web.lib/de.q60.mps.web.lib.msd\" folder=\"common\" />\n<modulePath path=\"$PROJECT_DIR$/de.q60.mps.web.model.mpsplugin/de.q60.mps.web.model.mpsplugin.msd\" folder=\"model\" />\n<modulePath path=\"$PROJECT_DIR$/de.q60.mps.web.model/de.q60.mps.web.model.msd\" folder=\"model\" />\n<modulePath path=\"$PROJECT_DIR$/de.q60.mps.web.ui.svg/de.q60.mps.web.ui.svg.msd\" folder=\"\" />\n- <modulePath path=\"$PROJECT_DIR$/de.q60.mps.web.build.rcp/de.q60.mps.web.build.rcp.msd\" folder=\"build\" />\n- <modulePath path=\"$PROJECT_DIR$/de.q60.mps.web.build.scripts/de.q60.mps.web.build.scripts.msd\" folder=\"build\" />\n</projectModules>\n</component>\n</project>\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "mps/de.q60.mps.shadowmodels.web.json/de.q60.mps.shadowmodels.web.json.mpl", "new_path": "mps/de.q60.mps.shadowmodels.web.json/de.q60.mps.shadowmodels.web.json.mpl", "diff": "</generators>\n<sourcePath />\n<dependencies>\n- <dependency reexport=\"false\">87f4b21e-a3a5-459e-a54b-408fd9eb7350(de.q60.mps.shadowmodels.web.lib)</dependency>\n+ <dependency reexport=\"false\">87f4b21e-a3a5-459e-a54b-408fd9eb7350(de.q60.mps.web.lib)</dependency>\n</dependencies>\n<languageVersions>\n<language slang=\"l:f3061a53-9226-4cc5-a443-f952ceaf5816:jetbrains.mps.baseLanguage\" version=\"8\" />\n<module reference=\"6ed54515-acc8-4d1e-a16c-9fd6cfe951ea(MPS.Core)\" version=\"0\" />\n<module reference=\"8865b7a8-5271-43d3-884c-6fd1d9cfdd34(MPS.OpenAPI)\" version=\"0\" />\n<module reference=\"0f2359af-040e-43bb-b438-cf024da41518(de.q60.mps.shadowmodels.web.json)\" version=\"0\" />\n- <module reference=\"87f4b21e-a3a5-459e-a54b-408fd9eb7350(de.q60.mps.shadowmodels.web.lib)\" version=\"0\" />\n+ <module reference=\"87f4b21e-a3a5-459e-a54b-408fd9eb7350(de.q60.mps.web.lib)\" version=\"0\" />\n<module reference=\"ceab5195-25ea-4f22-9b92-103b95ca8c0c(jetbrains.mps.lang.core)\" version=\"0\" />\n<module reference=\"a9e4c532-c5f5-4bb7-99ef-42abb73bbb70(jetbrains.mps.lang.descriptor.aspects)\" version=\"0\" />\n</dependencyVersions>\n" }, { "change_type": "MODIFY", "old_path": "mps/de.q60.mps.shadowmodels.web.server/de.q60.mps.shadowmodels.web.server.msd", "new_path": "mps/de.q60.mps.shadowmodels.web.server/de.q60.mps.shadowmodels.web.server.msd", "diff": "</models>\n<sourcePath />\n<dependencies>\n- <dependency reexport=\"false\">87f4b21e-a3a5-459e-a54b-408fd9eb7350(de.q60.mps.shadowmodels.web.lib)</dependency>\n+ <dependency reexport=\"false\">87f4b21e-a3a5-459e-a54b-408fd9eb7350(de.q60.mps.web.lib)</dependency>\n<dependency reexport=\"true\">e52a4835-844d-46a1-99f8-c06129db796f(de.q60.mps.shadowmodels.runtime)</dependency>\n<dependency reexport=\"false\">78874af2-5dd2-42a7-a21d-42fab3737d1d(de.q60.mps.shadowmodels.web)</dependency>\n<dependency reexport=\"false\">6f6906a4-f244-4806-a98b-0bc781cef2a8(de.q60.mps.shadowmodels.web.dom)</dependency>\n<module reference=\"78874af2-5dd2-42a7-a21d-42fab3737d1d(de.q60.mps.shadowmodels.web)\" version=\"1\" />\n<module reference=\"6f6906a4-f244-4806-a98b-0bc781cef2a8(de.q60.mps.shadowmodels.web.dom)\" version=\"0\" />\n<module reference=\"0f2359af-040e-43bb-b438-cf024da41518(de.q60.mps.shadowmodels.web.json)\" version=\"0\" />\n- <module reference=\"87f4b21e-a3a5-459e-a54b-408fd9eb7350(de.q60.mps.shadowmodels.web.lib)\" version=\"0\" />\n<module reference=\"eb8d1040-bff5-4126-8949-fdd95ef4c502(de.q60.mps.shadowmodels.web.server)\" version=\"0\" />\n+ <module reference=\"87f4b21e-a3a5-459e-a54b-408fd9eb7350(de.q60.mps.web.lib)\" version=\"0\" />\n<module reference=\"f3061a53-9226-4cc5-a443-f952ceaf5816(jetbrains.mps.baseLanguage)\" version=\"0\" />\n<module reference=\"e39e4a59-8cb6-498e-860e-8fa8361c0d90(jetbrains.mps.baseLanguage.scopes)\" version=\"0\" />\n<module reference=\"2d3c70e9-aab2-4870-8d8d-6036800e4103(jetbrains.mps.kernel)\" version=\"0\" />\n" }, { "change_type": "MODIFY", "old_path": "mps/de.q60.mps.web.build/models/de.q60.mps.web.build.mps", "new_path": "mps/de.q60.mps.web.build/models/de.q60.mps.web.build.mps", "diff": "<property role=\"TrG5h\" value=\"de.q60.mps.web.common\" />\n<node concept=\"1E1JtA\" id=\"7gF2HTviNPP\" role=\"2G$12L\">\n<property role=\"BnDLt\" value=\"true\" />\n- <property role=\"TrG5h\" value=\"de.q60.mps.shadowmodels.web.lib\" />\n+ <property role=\"TrG5h\" value=\"de.q60.mps.web.lib\" />\n<property role=\"3LESm3\" value=\"87f4b21e-a3a5-459e-a54b-408fd9eb7350\" />\n<node concept=\"398BVA\" id=\"3$7KuaihldX\" role=\"3LF7KH\">\n<ref role=\"398BVh\" node=\"3$7Kuaihl5X\" resolve=\"webmps.modules\" />\n<node concept=\"2Ry0Ak\" id=\"3$7Kuaihle1\" role=\"iGT6I\">\n- <property role=\"2Ry0Am\" value=\"de.q60.mps.shadowmodels.web.lib\" />\n- <node concept=\"2Ry0Ak\" id=\"3$7Kuaihle2\" role=\"2Ry0An\">\n- <property role=\"2Ry0Am\" value=\"de.q60.mps.shadowmodels.web.lib.msd\" />\n+ <property role=\"2Ry0Am\" value=\"de.q60.mps.web.lib\" />\n+ <node concept=\"2Ry0Ak\" id=\"2ANCVnFcI7i\" role=\"2Ry0An\">\n+ <property role=\"2Ry0Am\" value=\"de.q60.mps.web.lib.msd\" />\n</node>\n</node>\n</node>\n<ref role=\"3bR37D\" to=\"ffeo:mXGwHwhVPj\" resolve=\"JDK\" />\n</node>\n</node>\n- <node concept=\"1SiIV0\" id=\"3$7KuaihlLd\" role=\"3bR37C\">\n- <node concept=\"1BurEX\" id=\"3$7KuaihlLe\" role=\"1SiIV1\">\n- <node concept=\"398BVA\" id=\"3$7KuaihlL4\" role=\"1BurEY\">\n+ <node concept=\"1SiIV0\" id=\"2ANCVnFcIfI\" role=\"3bR37C\">\n+ <node concept=\"1BurEX\" id=\"2ANCVnFcIfJ\" role=\"1SiIV1\">\n+ <node concept=\"398BVA\" id=\"2ANCVnFcIf_\" role=\"1BurEY\">\n<ref role=\"398BVh\" node=\"3$7Kuaihl5X\" resolve=\"webmps.modules\" />\n- <node concept=\"2Ry0Ak\" id=\"3$7KuaihlL5\" role=\"iGT6I\">\n- <property role=\"2Ry0Am\" value=\"de.q60.mps.shadowmodels.web.lib\" />\n- <node concept=\"2Ry0Ak\" id=\"3$7KuaihlL6\" role=\"2Ry0An\">\n+ <node concept=\"2Ry0Ak\" id=\"2ANCVnFcIfA\" role=\"iGT6I\">\n+ <property role=\"2Ry0Am\" value=\"de.q60.mps.web.lib\" />\n+ <node concept=\"2Ry0Ak\" id=\"2ANCVnFcIfB\" role=\"2Ry0An\">\n<property role=\"2Ry0Am\" value=\"lib\" />\n- <node concept=\"2Ry0Ak\" id=\"3$7KuaihlL7\" role=\"2Ry0An\">\n+ <node concept=\"2Ry0Ak\" id=\"2ANCVnFcIfC\" role=\"2Ry0An\">\n<property role=\"2Ry0Am\" value=\"java_websocket.jar\" />\n</node>\n</node>\n</node>\n</node>\n</node>\n- <node concept=\"1SiIV0\" id=\"3$7KuaihlLo\" role=\"3bR37C\">\n- <node concept=\"1BurEX\" id=\"3$7KuaihlLp\" role=\"1SiIV1\">\n- <node concept=\"398BVA\" id=\"3$7KuaihlLf\" role=\"1BurEY\">\n+ <node concept=\"1SiIV0\" id=\"2ANCVnFcIfT\" role=\"3bR37C\">\n+ <node concept=\"1BurEX\" id=\"2ANCVnFcIfU\" role=\"1SiIV1\">\n+ <node concept=\"398BVA\" id=\"2ANCVnFcIfK\" role=\"1BurEY\">\n<ref role=\"398BVh\" node=\"3$7Kuaihl5X\" resolve=\"webmps.modules\" />\n- <node concept=\"2Ry0Ak\" id=\"3$7KuaihlLg\" role=\"iGT6I\">\n- <property role=\"2Ry0Am\" value=\"de.q60.mps.shadowmodels.web.lib\" />\n- <node concept=\"2Ry0Ak\" id=\"3$7KuaihlLh\" role=\"2Ry0An\">\n+ <node concept=\"2Ry0Ak\" id=\"2ANCVnFcIfL\" role=\"iGT6I\">\n+ <property role=\"2Ry0Am\" value=\"de.q60.mps.web.lib\" />\n+ <node concept=\"2Ry0Ak\" id=\"2ANCVnFcIfM\" role=\"2Ry0An\">\n<property role=\"2Ry0Am\" value=\"lib\" />\n- <node concept=\"2Ry0Ak\" id=\"3$7KuaihlLi\" role=\"2Ry0An\">\n+ <node concept=\"2Ry0Ak\" id=\"2ANCVnFcIfN\" role=\"2Ry0An\">\n<property role=\"2Ry0Am\" value=\"json-20160810.jar\" />\n</node>\n</node>\n</node>\n</node>\n</node>\n- <node concept=\"1SiIV0\" id=\"3$7KuaihlLz\" role=\"3bR37C\">\n- <node concept=\"1BurEX\" id=\"3$7KuaihlL$\" role=\"1SiIV1\">\n- <node concept=\"398BVA\" id=\"3$7KuaihlLq\" role=\"1BurEY\">\n+ <node concept=\"1SiIV0\" id=\"2ANCVnFcIg4\" role=\"3bR37C\">\n+ <node concept=\"1BurEX\" id=\"2ANCVnFcIg5\" role=\"1SiIV1\">\n+ <node concept=\"398BVA\" id=\"2ANCVnFcIfV\" role=\"1BurEY\">\n<ref role=\"398BVh\" node=\"3$7Kuaihl5X\" resolve=\"webmps.modules\" />\n- <node concept=\"2Ry0Ak\" id=\"3$7KuaihlLr\" role=\"iGT6I\">\n- <property role=\"2Ry0Am\" value=\"de.q60.mps.shadowmodels.web.lib\" />\n- <node concept=\"2Ry0Ak\" id=\"3$7KuaihlLs\" role=\"2Ry0An\">\n+ <node concept=\"2Ry0Ak\" id=\"2ANCVnFcIfW\" role=\"iGT6I\">\n+ <property role=\"2Ry0Am\" value=\"de.q60.mps.web.lib\" />\n+ <node concept=\"2Ry0Ak\" id=\"2ANCVnFcIfX\" role=\"2Ry0An\">\n<property role=\"2Ry0Am\" value=\"lib\" />\n- <node concept=\"2Ry0Ak\" id=\"3$7KuaihlLt\" role=\"2Ry0An\">\n+ <node concept=\"2Ry0Ak\" id=\"2ANCVnFcIfY\" role=\"2Ry0An\">\n<property role=\"2Ry0Am\" value=\"gson-2.8.5.jar\" />\n</node>\n</node>\n</node>\n</node>\n</node>\n- <node concept=\"1SiIV0\" id=\"3$7KuaihlLI\" role=\"3bR37C\">\n- <node concept=\"1BurEX\" id=\"3$7KuaihlLJ\" role=\"1SiIV1\">\n- <node concept=\"398BVA\" id=\"3$7KuaihlL_\" role=\"1BurEY\">\n+ <node concept=\"1SiIV0\" id=\"2ANCVnFcIgf\" role=\"3bR37C\">\n+ <node concept=\"1BurEX\" id=\"2ANCVnFcIgg\" role=\"1SiIV1\">\n+ <node concept=\"398BVA\" id=\"2ANCVnFcIg6\" role=\"1BurEY\">\n<ref role=\"398BVh\" node=\"3$7Kuaihl5X\" resolve=\"webmps.modules\" />\n- <node concept=\"2Ry0Ak\" id=\"3$7KuaihlLA\" role=\"iGT6I\">\n- <property role=\"2Ry0Am\" value=\"de.q60.mps.shadowmodels.web.lib\" />\n- <node concept=\"2Ry0Ak\" id=\"3$7KuaihlLB\" role=\"2Ry0An\">\n+ <node concept=\"2Ry0Ak\" id=\"2ANCVnFcIg7\" role=\"iGT6I\">\n+ <property role=\"2Ry0Am\" value=\"de.q60.mps.web.lib\" />\n+ <node concept=\"2Ry0Ak\" id=\"2ANCVnFcIg8\" role=\"2Ry0An\">\n<property role=\"2Ry0Am\" value=\"lib\" />\n- <node concept=\"2Ry0Ak\" id=\"3$7KuaihlLC\" role=\"2Ry0An\">\n+ <node concept=\"2Ry0Ak\" id=\"2ANCVnFcIg9\" role=\"2Ry0An\">\n<property role=\"2Ry0Am\" value=\"gson-extras-2.8.5.jar\" />\n</node>\n</node>\n</node>\n<node concept=\"1SiIV0\" id=\"7gF2HTviO9s\" role=\"3bR37C\">\n<node concept=\"3bR9La\" id=\"7gF2HTviO9t\" role=\"1SiIV1\">\n- <ref role=\"3bR37D\" node=\"7gF2HTviNPP\" resolve=\"de.q60.mps.shadowmodels.web.lib\" />\n+ <ref role=\"3bR37D\" node=\"7gF2HTviNPP\" resolve=\"de.q60.mps.web.lib\" />\n</node>\n</node>\n</node>\n</node>\n<node concept=\"1SiIV0\" id=\"7gF2HTviOaO\" role=\"3bR37C\">\n<node concept=\"3bR9La\" id=\"7gF2HTviOaP\" role=\"1SiIV1\">\n- <ref role=\"3bR37D\" node=\"7gF2HTviNPP\" resolve=\"de.q60.mps.shadowmodels.web.lib\" />\n+ <ref role=\"3bR37D\" node=\"7gF2HTviNPP\" resolve=\"de.q60.mps.web.lib\" />\n</node>\n</node>\n<node concept=\"1SiIV0\" id=\"7gF2HTviOaQ\" role=\"3bR37C\">\n</node>\n<node concept=\"1SiIV0\" id=\"7gF2HTviO9y\" role=\"3bR37C\">\n<node concept=\"3bR9La\" id=\"7gF2HTviO9z\" role=\"1SiIV1\">\n- <ref role=\"3bR37D\" node=\"7gF2HTviNPP\" resolve=\"de.q60.mps.shadowmodels.web.lib\" />\n+ <ref role=\"3bR37D\" node=\"7gF2HTviNPP\" resolve=\"de.q60.mps.web.lib\" />\n</node>\n</node>\n<node concept=\"1SiIV0\" id=\"7gF2HTvj1RM\" role=\"3bR37C\">\n<node concept=\"1SiIV0\" id=\"7gF2HTviO9q\" role=\"3bR37C\">\n<node concept=\"3bR9La\" id=\"7gF2HTviO9r\" role=\"1SiIV1\">\n<property role=\"3bR36h\" value=\"true\" />\n- <ref role=\"3bR37D\" node=\"7gF2HTviNPP\" resolve=\"de.q60.mps.shadowmodels.web.lib\" />\n+ <ref role=\"3bR37D\" node=\"7gF2HTviNPP\" resolve=\"de.q60.mps.web.lib\" />\n</node>\n</node>\n<node concept=\"1SiIV0\" id=\"7gF2HTvj1RA\" role=\"3bR37C\">\n" }, { "change_type": "RENAME", "old_path": "mps/de.q60.mps.shadowmodels.web.lib/de.q60.mps.shadowmodels.web.lib.msd", "new_path": "mps/de.q60.mps.web.lib/de.q60.mps.web.lib.msd", "diff": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n-<solution name=\"de.q60.mps.shadowmodels.web.lib\" uuid=\"87f4b21e-a3a5-459e-a54b-408fd9eb7350\" moduleVersion=\"0\" compileInMPS=\"true\">\n+<solution name=\"de.q60.mps.web.lib\" uuid=\"87f4b21e-a3a5-459e-a54b-408fd9eb7350\" moduleVersion=\"0\" compileInMPS=\"true\">\n<models>\n<modelRoot contentPath=\"${module}\" type=\"default\">\n<sourceRoot location=\"models\" />\n</languageVersions>\n<dependencyVersions>\n<module reference=\"6354ebe7-c22a-4a0f-ac54-50b52ab9b065(JDK)\" version=\"0\" />\n- <module reference=\"87f4b21e-a3a5-459e-a54b-408fd9eb7350(de.q60.mps.shadowmodels.web.lib)\" version=\"0\" />\n+ <module reference=\"87f4b21e-a3a5-459e-a54b-408fd9eb7350(de.q60.mps.web.lib)\" version=\"0\" />\n</dependencyVersions>\n</solution>\n" }, { "change_type": "RENAME", "old_path": "mps/de.q60.mps.shadowmodels.web.lib/lib/gson-2.8.5.jar", "new_path": "mps/de.q60.mps.web.lib/lib/gson-2.8.5.jar", "diff": "" }, { "change_type": "RENAME", "old_path": "mps/de.q60.mps.shadowmodels.web.lib/lib/gson-extras-2.8.5.jar", "new_path": "mps/de.q60.mps.web.lib/lib/gson-extras-2.8.5.jar", "diff": "" }, { "change_type": "RENAME", "old_path": "mps/de.q60.mps.shadowmodels.web.lib/lib/java_websocket.jar", "new_path": "mps/de.q60.mps.web.lib/lib/java_websocket.jar", "diff": "" }, { "change_type": "RENAME", "old_path": "mps/de.q60.mps.shadowmodels.web.lib/lib/json-20160810.jar", "new_path": "mps/de.q60.mps.web.lib/lib/json-20160810.jar", "diff": "" }, { "change_type": "MODIFY", "old_path": "mps/de.q60.mps.web.model.mpsplugin/de.q60.mps.web.model.mpsplugin.msd", "new_path": "mps/de.q60.mps.web.model.mpsplugin/de.q60.mps.web.model.mpsplugin.msd", "diff": "<dependency reexport=\"false\">5622e615-959d-4843-9df6-ef04ee578c18(de.q60.mps.web.model)</dependency>\n<dependency reexport=\"false\">ceab5195-25ea-4f22-9b92-103b95ca8c0c(jetbrains.mps.lang.core)</dependency>\n<dependency reexport=\"false\">8d29d73f-ed99-4652-ae0a-083cdfe53c34(jetbrains.mps.ide.platform)</dependency>\n- <dependency reexport=\"true\">87f4b21e-a3a5-459e-a54b-408fd9eb7350(de.q60.mps.shadowmodels.web.lib)</dependency>\n+ <dependency reexport=\"true\">87f4b21e-a3a5-459e-a54b-408fd9eb7350(de.q60.mps.web.lib)</dependency>\n</dependencies>\n<languageVersions>\n<language slang=\"l:f3061a53-9226-4cc5-a443-f952ceaf5816:jetbrains.mps.baseLanguage\" version=\"8\" />\n<module reference=\"ecfb9949-7433-4db5-85de-0f84d172e4ce(de.q60.mps.libs)\" version=\"0\" />\n<module reference=\"18463265-6d45-4514-82f1-cf7eb1222492(de.q60.mps.polymorphicfunctions.runtime)\" version=\"0\" />\n<module reference=\"e52a4835-844d-46a1-99f8-c06129db796f(de.q60.mps.shadowmodels.runtime)\" version=\"0\" />\n- <module reference=\"87f4b21e-a3a5-459e-a54b-408fd9eb7350(de.q60.mps.shadowmodels.web.lib)\" version=\"0\" />\n+ <module reference=\"87f4b21e-a3a5-459e-a54b-408fd9eb7350(de.q60.mps.web.lib)\" version=\"0\" />\n<module reference=\"5622e615-959d-4843-9df6-ef04ee578c18(de.q60.mps.web.model)\" version=\"0\" />\n<module reference=\"c5e5433e-201f-43e2-ad14-a6cba8c80cd6(de.q60.mps.web.model.mpsplugin)\" version=\"0\" />\n<module reference=\"ad11c189-1efe-4d3c-9d2e-6c97efb43add(de.q60.mps.web.server)\" version=\"0\" />\n" }, { "change_type": "MODIFY", "old_path": "mps/de.q60.mps.web.model/de.q60.mps.web.model.msd", "new_path": "mps/de.q60.mps.web.model/de.q60.mps.web.model.msd", "diff": "<dependency reexport=\"false\">6354ebe7-c22a-4a0f-ac54-50b52ab9b065(JDK)</dependency>\n<dependency reexport=\"false\">ecfb9949-7433-4db5-85de-0f84d172e4ce(de.q60.mps.libs)</dependency>\n<dependency reexport=\"false\">6ed54515-acc8-4d1e-a16c-9fd6cfe951ea(MPS.Core)</dependency>\n- <dependency reexport=\"false\">87f4b21e-a3a5-459e-a54b-408fd9eb7350(de.q60.mps.shadowmodels.web.lib)</dependency>\n+ <dependency reexport=\"false\">87f4b21e-a3a5-459e-a54b-408fd9eb7350(de.q60.mps.web.lib)</dependency>\n<dependency reexport=\"false\">8865b7a8-5271-43d3-884c-6fd1d9cfdd34(MPS.OpenAPI)</dependency>\n</dependencies>\n<languageVersions>\n<module reference=\"ecfb9949-7433-4db5-85de-0f84d172e4ce(de.q60.mps.libs)\" version=\"0\" />\n<module reference=\"18463265-6d45-4514-82f1-cf7eb1222492(de.q60.mps.polymorphicfunctions.runtime)\" version=\"0\" />\n<module reference=\"e52a4835-844d-46a1-99f8-c06129db796f(de.q60.mps.shadowmodels.runtime)\" version=\"0\" />\n- <module reference=\"87f4b21e-a3a5-459e-a54b-408fd9eb7350(de.q60.mps.shadowmodels.web.lib)\" version=\"0\" />\n+ <module reference=\"87f4b21e-a3a5-459e-a54b-408fd9eb7350(de.q60.mps.web.lib)\" version=\"0\" />\n<module reference=\"5622e615-959d-4843-9df6-ef04ee578c18(de.q60.mps.web.model)\" version=\"0\" />\n</dependencyVersions>\n</solution>\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
Rename de.q60.mps.shadowmodels.web.lib -> de.q60.mps.web.lib
426,496
13.08.2019 16:01:09
-7,200
e628a15510515041291e307ece5703af05aa7f8a
Rename de.q60.mps.shadowmodels.web.server -> de.q60.mps.web.ui.sm.server
[ { "change_type": "MODIFY", "old_path": "mps/.mps/modules.xml", "new_path": "mps/.mps/modules.xml", "diff": "<projectModules>\n<modulePath path=\"$PROJECT_DIR$/de.q60.mps.shadowmodels.web.dom/de.q60.mps.shadowmodels.web.dom.mpl\" folder=\"ui.shadowmodels\" />\n<modulePath path=\"$PROJECT_DIR$/de.q60.mps.shadowmodels.web.json/de.q60.mps.shadowmodels.web.json.mpl\" folder=\"ui.shadowmodels\" />\n- <modulePath path=\"$PROJECT_DIR$/de.q60.mps.shadowmodels.web.server/de.q60.mps.shadowmodels.web.server.msd\" folder=\"ui.shadowmodels\" />\n<modulePath path=\"$PROJECT_DIR$/de.q60.mps.shadowmodels.web/de.q60.mps.shadowmodels.web.mpl\" folder=\"ui.shadowmodels\" />\n<modulePath path=\"$PROJECT_DIR$/de.q60.mps.web.build.rcp/de.q60.mps.web.build.rcp.msd\" folder=\"build\" />\n<modulePath path=\"$PROJECT_DIR$/de.q60.mps.web.build.scripts/de.q60.mps.web.build.scripts.msd\" folder=\"build\" />\n<modulePath path=\"$PROJECT_DIR$/de.q60.mps.web.lib/de.q60.mps.web.lib.msd\" folder=\"common\" />\n<modulePath path=\"$PROJECT_DIR$/de.q60.mps.web.model.mpsplugin/de.q60.mps.web.model.mpsplugin.msd\" folder=\"model\" />\n<modulePath path=\"$PROJECT_DIR$/de.q60.mps.web.model/de.q60.mps.web.model.msd\" folder=\"model\" />\n+ <modulePath path=\"$PROJECT_DIR$/de.q60.mps.web.ui.sm.server/de.q60.mps.web.ui.sm.server.msd\" folder=\"ui.shadowmodels\" />\n<modulePath path=\"$PROJECT_DIR$/de.q60.mps.web.ui.svg/de.q60.mps.web.ui.svg.msd\" folder=\"\" />\n</projectModules>\n</component>\n" }, { "change_type": "MODIFY", "old_path": "mps/de.q60.mps.web.build/models/de.q60.mps.web.build.mps", "new_path": "mps/de.q60.mps.web.build/models/de.q60.mps.web.build.mps", "diff": "</node>\n<node concept=\"1E1JtA\" id=\"7gF2HTviNPU\" role=\"2G$12L\">\n<property role=\"BnDLt\" value=\"true\" />\n- <property role=\"TrG5h\" value=\"de.q60.mps.shadowmodels.web.server\" />\n+ <property role=\"TrG5h\" value=\"de.q60.mps.web.ui.sm.server\" />\n<property role=\"3LESm3\" value=\"eb8d1040-bff5-4126-8949-fdd95ef4c502\" />\n<node concept=\"398BVA\" id=\"3$7Kuaihlhl\" role=\"3LF7KH\">\n<ref role=\"398BVh\" node=\"3$7Kuaihl5X\" resolve=\"webmps.modules\" />\n<node concept=\"2Ry0Ak\" id=\"3$7Kuaihlhp\" role=\"iGT6I\">\n- <property role=\"2Ry0Am\" value=\"de.q60.mps.shadowmodels.web.server\" />\n- <node concept=\"2Ry0Ak\" id=\"3$7Kuaihlhq\" role=\"2Ry0An\">\n- <property role=\"2Ry0Am\" value=\"de.q60.mps.shadowmodels.web.server.msd\" />\n+ <property role=\"2Ry0Am\" value=\"de.q60.mps.web.ui.sm.server\" />\n+ <node concept=\"2Ry0Ak\" id=\"2ANCVnFcOL5\" role=\"2Ry0An\">\n+ <property role=\"2Ry0Am\" value=\"de.q60.mps.web.ui.sm.server.msd\" />\n</node>\n</node>\n</node>\n" }, { "change_type": "RENAME", "old_path": "mps/de.q60.mps.shadowmodels.web.server/de.q60.mps.shadowmodels.web.server.msd", "new_path": "mps/de.q60.mps.web.ui.sm.server/de.q60.mps.web.ui.sm.server.msd", "diff": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n-<solution name=\"de.q60.mps.shadowmodels.web.server\" uuid=\"eb8d1040-bff5-4126-8949-fdd95ef4c502\" moduleVersion=\"0\" pluginKind=\"PLUGIN_OTHER\" compileInMPS=\"true\">\n+<solution name=\"de.q60.mps.web.ui.sm.server\" uuid=\"eb8d1040-bff5-4126-8949-fdd95ef4c502\" moduleVersion=\"0\" pluginKind=\"PLUGIN_OTHER\" compileInMPS=\"true\">\n<models>\n<modelRoot contentPath=\"${module}\" type=\"default\">\n<sourceRoot location=\"models\" />\n<module reference=\"78874af2-5dd2-42a7-a21d-42fab3737d1d(de.q60.mps.shadowmodels.web)\" version=\"1\" />\n<module reference=\"6f6906a4-f244-4806-a98b-0bc781cef2a8(de.q60.mps.shadowmodels.web.dom)\" version=\"0\" />\n<module reference=\"0f2359af-040e-43bb-b438-cf024da41518(de.q60.mps.shadowmodels.web.json)\" version=\"0\" />\n- <module reference=\"eb8d1040-bff5-4126-8949-fdd95ef4c502(de.q60.mps.shadowmodels.web.server)\" version=\"0\" />\n<module reference=\"87f4b21e-a3a5-459e-a54b-408fd9eb7350(de.q60.mps.web.lib)\" version=\"0\" />\n+ <module reference=\"eb8d1040-bff5-4126-8949-fdd95ef4c502(de.q60.mps.web.ui.sm.server)\" version=\"0\" />\n<module reference=\"f3061a53-9226-4cc5-a443-f952ceaf5816(jetbrains.mps.baseLanguage)\" version=\"0\" />\n<module reference=\"e39e4a59-8cb6-498e-860e-8fa8361c0d90(jetbrains.mps.baseLanguage.scopes)\" version=\"0\" />\n<module reference=\"2d3c70e9-aab2-4870-8d8d-6036800e4103(jetbrains.mps.kernel)\" version=\"0\" />\n" }, { "change_type": "RENAME", "old_path": "mps/de.q60.mps.shadowmodels.web.server/models/de.q60.mps.shadowmodels.web.server.plugin.mps", "new_path": "mps/de.q60.mps.web.ui.sm.server/models/de.q60.mps.web.ui.sm.server.plugin.mps", "diff": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n-<model ref=\"r:f8990486-c591-4463-8538-99bfa890834b(de.q60.mps.shadowmodels.web.server.plugin)\">\n+<model ref=\"r:f8990486-c591-4463-8538-99bfa890834b(de.q60.mps.web.ui.sm.server.plugin)\">\n<persistence version=\"9\" />\n<languages>\n<use id=\"ef7bf5ac-d06c-4342-b11d-e42104eb9343\" name=\"jetbrains.mps.lang.plugin.standalone\" version=\"0\" />\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
Rename de.q60.mps.shadowmodels.web.server -> de.q60.mps.web.ui.sm.server
426,496
13.08.2019 16:05:58
-7,200
d883410c61598184c9faa5a47f9057312d3962a2
Fix MPS build script
[ { "change_type": "MODIFY", "old_path": "mps/de.q60.mps.web.build/models/de.q60.mps.web.build.mps", "new_path": "mps/de.q60.mps.web.build/models/de.q60.mps.web.build.mps", "diff": "<node concept=\"398BVA\" id=\"7gF2HTvk5JG\" role=\"2HvfZ0\">\n<ref role=\"398BVh\" node=\"3$7Kuaihl5X\" resolve=\"webmps.modules\" />\n<node concept=\"2Ry0Ak\" id=\"7gF2HTvk5M8\" role=\"iGT6I\">\n- <property role=\"2Ry0Am\" value=\"de.q60.mps.shadowmodels.web.lib\" />\n+ <property role=\"2Ry0Am\" value=\"de.q60.mps.web.lib\" />\n<node concept=\"2Ry0Ak\" id=\"7gF2HTvk5Mb\" role=\"2Ry0An\">\n<property role=\"2Ry0Am\" value=\"lib\" />\n</node>\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
Fix MPS build script
426,496
13.08.2019 16:09:44
-7,200
9f2caee14d4e1f9833b6039048ee5bb9081b6e5a
Rename de.q60.mps.shadowmodels.web.dom -> de.q60.mps.web.ui.sm.dom
[ { "change_type": "MODIFY", "old_path": "mps/.mps/modules.xml", "new_path": "mps/.mps/modules.xml", "diff": "<project version=\"4\">\n<component name=\"MPSProject\">\n<projectModules>\n- <modulePath path=\"$PROJECT_DIR$/de.q60.mps.shadowmodels.web.dom/de.q60.mps.shadowmodels.web.dom.mpl\" folder=\"ui.shadowmodels\" />\n<modulePath path=\"$PROJECT_DIR$/de.q60.mps.shadowmodels.web.json/de.q60.mps.shadowmodels.web.json.mpl\" folder=\"ui.shadowmodels\" />\n<modulePath path=\"$PROJECT_DIR$/de.q60.mps.shadowmodels.web/de.q60.mps.shadowmodels.web.mpl\" folder=\"ui.shadowmodels\" />\n<modulePath path=\"$PROJECT_DIR$/de.q60.mps.web.build.rcp/de.q60.mps.web.build.rcp.msd\" folder=\"build\" />\n<modulePath path=\"$PROJECT_DIR$/de.q60.mps.web.lib/de.q60.mps.web.lib.msd\" folder=\"common\" />\n<modulePath path=\"$PROJECT_DIR$/de.q60.mps.web.model.mpsplugin/de.q60.mps.web.model.mpsplugin.msd\" folder=\"model\" />\n<modulePath path=\"$PROJECT_DIR$/de.q60.mps.web.model/de.q60.mps.web.model.msd\" folder=\"model\" />\n+ <modulePath path=\"$PROJECT_DIR$/de.q60.mps.web.ui.sm.dom/de.q60.mps.web.ui.sm.dom.mpl\" folder=\"ui.shadowmodels\" />\n<modulePath path=\"$PROJECT_DIR$/de.q60.mps.web.ui.sm.server/de.q60.mps.web.ui.sm.server.msd\" folder=\"ui.shadowmodels\" />\n<modulePath path=\"$PROJECT_DIR$/de.q60.mps.web.ui.svg/de.q60.mps.web.ui.svg.msd\" folder=\"\" />\n</projectModules>\n" }, { "change_type": "MODIFY", "old_path": "mps/de.q60.mps.shadowmodels.web/de.q60.mps.shadowmodels.web.mpl", "new_path": "mps/de.q60.mps.shadowmodels.web/de.q60.mps.shadowmodels.web.mpl", "diff": "<dependency reexport=\"false\">6354ebe7-c22a-4a0f-ac54-50b52ab9b065(JDK)</dependency>\n<dependency reexport=\"false\">18bc6592-03a6-4e29-a83a-7ff23bde13ba(jetbrains.mps.lang.editor)</dependency>\n<dependency reexport=\"false\">0f2359af-040e-43bb-b438-cf024da41518(de.q60.mps.shadowmodels.web.json)</dependency>\n- <dependency reexport=\"false\">6f6906a4-f244-4806-a98b-0bc781cef2a8(de.q60.mps.shadowmodels.web.dom)</dependency>\n+ <dependency reexport=\"false\">6f6906a4-f244-4806-a98b-0bc781cef2a8(de.q60.mps.web.ui.sm.dom)</dependency>\n</dependencies>\n<languageVersions>\n<language slang=\"l:96089812-effe-4a96-bb2e-75f8162046af:de.q60.mps.shadowmodels.gen.afterPF\" version=\"0\" />\n<module reference=\"0bf7bc3b-b11d-42e4-b160-93d72af96397(de.q60.mps.shadowmodels.runtimelang)\" version=\"0\" />\n<module reference=\"a7322769-ef64-4daa-a2f4-fd4228fb713e(de.q60.mps.shadowmodels.target.text)\" version=\"0\" />\n<module reference=\"78874af2-5dd2-42a7-a21d-42fab3737d1d(de.q60.mps.shadowmodels.web)\" version=\"0\" />\n- <module reference=\"6f6906a4-f244-4806-a98b-0bc781cef2a8(de.q60.mps.shadowmodels.web.dom)\" version=\"0\" />\n<module reference=\"0f2359af-040e-43bb-b438-cf024da41518(de.q60.mps.shadowmodels.web.json)\" version=\"0\" />\n+ <module reference=\"6f6906a4-f244-4806-a98b-0bc781cef2a8(de.q60.mps.web.ui.sm.dom)\" version=\"0\" />\n<module reference=\"f3061a53-9226-4cc5-a443-f952ceaf5816(jetbrains.mps.baseLanguage)\" version=\"0\" />\n<module reference=\"443f4c36-fcf5-4eb6-9500-8d06ed259e3e(jetbrains.mps.baseLanguage.classifiers)\" version=\"0\" />\n<module reference=\"fd392034-7849-419d-9071-12563d152375(jetbrains.mps.baseLanguage.closures)\" version=\"0\" />\n" }, { "change_type": "MODIFY", "old_path": "mps/de.q60.mps.shadowmodels.web/models/structure.mps", "new_path": "mps/de.q60.mps.shadowmodels.web/models/structure.mps", "diff": "</languages>\n<imports>\n<import index=\"tpck\" ref=\"r:00000000-0000-4000-0000-011c89590288(jetbrains.mps.lang.core.structure)\" implicit=\"true\" />\n- <import index=\"70w2\" ref=\"r:59e1f3dd-5dad-4bbd-ad65-fef01059d9d2(de.q60.mps.shadowmodels.web.dom.structure)\" implicit=\"true\" />\n+ <import index=\"70w2\" ref=\"r:59e1f3dd-5dad-4bbd-ad65-fef01059d9d2(de.q60.mps.web.ui.sm.dom.structure)\" implicit=\"true\" />\n</imports>\n<registry>\n<language id=\"c72da2b9-7cce-4447-8389-f407dc1158b7\" name=\"jetbrains.mps.lang.structure\">\n" }, { "change_type": "MODIFY", "old_path": "mps/de.q60.mps.web.build/models/de.q60.mps.web.build.mps", "new_path": "mps/de.q60.mps.web.build/models/de.q60.mps.web.build.mps", "diff": "</node>\n<node concept=\"1SiIV0\" id=\"7gF2HTviO9m\" role=\"3bR37C\">\n<node concept=\"3bR9La\" id=\"7gF2HTviO9n\" role=\"1SiIV1\">\n- <ref role=\"3bR37D\" node=\"7gF2HTviNPF\" resolve=\"de.q60.mps.shadowmodels.web.dom\" />\n+ <ref role=\"3bR37D\" node=\"7gF2HTviNPF\" resolve=\"de.q60.mps.web.ui.sm.dom\" />\n</node>\n</node>\n<node concept=\"1SiIV0\" id=\"7gF2HTvj1Rw\" role=\"3bR37C\">\n</node>\n<node concept=\"1E1JtD\" id=\"7gF2HTviNPF\" role=\"2G$12L\">\n<property role=\"BnDLt\" value=\"true\" />\n- <property role=\"TrG5h\" value=\"de.q60.mps.shadowmodels.web.dom\" />\n+ <property role=\"TrG5h\" value=\"de.q60.mps.web.ui.sm.dom\" />\n<property role=\"3LESm3\" value=\"6f6906a4-f244-4806-a98b-0bc781cef2a8\" />\n<node concept=\"398BVA\" id=\"3$7Kuaihlgv\" role=\"3LF7KH\">\n<ref role=\"398BVh\" node=\"3$7Kuaihl5X\" resolve=\"webmps.modules\" />\n<node concept=\"2Ry0Ak\" id=\"3$7Kuaihlgz\" role=\"iGT6I\">\n- <property role=\"2Ry0Am\" value=\"de.q60.mps.shadowmodels.web.dom\" />\n- <node concept=\"2Ry0Ak\" id=\"3$7Kuaihlg$\" role=\"2Ry0An\">\n- <property role=\"2Ry0Am\" value=\"de.q60.mps.shadowmodels.web.dom.mpl\" />\n+ <property role=\"2Ry0Am\" value=\"de.q60.mps.web.ui.sm.dom\" />\n+ <node concept=\"2Ry0Ak\" id=\"6GOzicS76kH\" role=\"2Ry0An\">\n+ <property role=\"2Ry0Am\" value=\"de.q60.mps.web.ui.sm.dom.mpl\" />\n</node>\n</node>\n</node>\n<node concept=\"1yeLz9\" id=\"7gF2HTviNQI\" role=\"1TViLv\">\n- <property role=\"TrG5h\" value=\"de.q60.mps.shadowmodels.web.dom#01\" />\n+ <property role=\"TrG5h\" value=\"de.q60.mps.web.ui.sm.dom#01\" />\n<property role=\"3LESm3\" value=\"8eeab8ed-d51a-4f98-8dd9-0a43d1a66dd7\" />\n</node>\n</node>\n</node>\n<node concept=\"1SiIV0\" id=\"7gF2HTviOaQ\" role=\"3bR37C\">\n<node concept=\"3bR9La\" id=\"7gF2HTviOaR\" role=\"1SiIV1\">\n- <ref role=\"3bR37D\" node=\"7gF2HTviNPF\" resolve=\"de.q60.mps.shadowmodels.web.dom\" />\n+ <ref role=\"3bR37D\" node=\"7gF2HTviNPF\" resolve=\"de.q60.mps.web.ui.sm.dom\" />\n</node>\n</node>\n<node concept=\"1SiIV0\" id=\"7gF2HTvj1T2\" role=\"3bR37C\">\n" }, { "change_type": "MODIFY", "old_path": "mps/de.q60.mps.web.model.mpsplugin/models/de.q60.mps.web.model.mpsplugin.mps", "new_path": "mps/de.q60.mps.web.model.mpsplugin/models/de.q60.mps.web.model.mpsplugin.mps", "diff": "<import index=\"28m1\" ref=\"6354ebe7-c22a-4a0f-ac54-50b52ab9b065/java:java.time(JDK/)\" />\n<import index=\"tpck\" ref=\"r:00000000-0000-4000-0000-011c89590288(jetbrains.mps.lang.core.structure)\" />\n<import index=\"zf81\" ref=\"6354ebe7-c22a-4a0f-ac54-50b52ab9b065/java:java.net(JDK/)\" />\n- <import index=\"ffp0\" ref=\"87f4b21e-a3a5-459e-a54b-408fd9eb7350/java:org.java_websocket(de.q60.mps.shadowmodels.web.lib/)\" />\n+ <import index=\"ffp0\" ref=\"87f4b21e-a3a5-459e-a54b-408fd9eb7350/java:org.java_websocket(de.q60.mps.web.lib/)\" />\n<import index=\"mxf6\" ref=\"87f4b21e-a3a5-459e-a54b-408fd9eb7350/java:org.json(de.q60.mps.shadowmodels.web.lib/)\" />\n<import index=\"3o3z\" ref=\"ecfb9949-7433-4db5-85de-0f84d172e4ce/java:com.google.common.collect(de.q60.mps.libs/)\" />\n<import index=\"p2o5\" ref=\"87f4b21e-a3a5-459e-a54b-408fd9eb7350/java:org.java_websocket.client(de.q60.mps.shadowmodels.web.lib/)\" />\n- <import index=\"bge5\" ref=\"87f4b21e-a3a5-459e-a54b-408fd9eb7350/java:org.java_websocket.handshake(de.q60.mps.shadowmodels.web.lib/)\" />\n+ <import index=\"bge5\" ref=\"87f4b21e-a3a5-459e-a54b-408fd9eb7350/java:org.java_websocket.handshake(de.q60.mps.web.lib/)\" />\n<import index=\"3a50\" ref=\"742f6602-5a2f-4313-aa6e-ae1cd4ffdc61/java:jetbrains.mps.ide(MPS.Platform/)\" />\n<import index=\"zdal\" ref=\"r:88aa2c17-3990-45f2-9b79-06884112d260(de.q60.mps.web.model)\" />\n<import index=\"ydze\" ref=\"r:c65aa0cf-b22b-4cca-bd88-3210b1c2f55f(de.q60.mps.web.model.operations)\" />\n" }, { "change_type": "MODIFY", "old_path": "mps/de.q60.mps.web.model/models/de.q60.mps.web.model.operations.mps", "new_path": "mps/de.q60.mps.web.model/models/de.q60.mps.web.model.operations.mps", "diff": "<import index=\"mjcn\" ref=\"r:89ac1ee0-92ac-49e1-83e6-167854d2040e(de.q60.mps.shadowmodels.runtime.model)\" />\n<import index=\"25x5\" ref=\"6354ebe7-c22a-4a0f-ac54-50b52ab9b065/java:java.text(JDK/)\" />\n<import index=\"3d38\" ref=\"r:bc160b50-5a4e-4f99-ba07-a7b7116dab7a(de.q60.mps.incremental.util)\" />\n- <import index=\"wy2b\" ref=\"87f4b21e-a3a5-459e-a54b-408fd9eb7350/java:com.google.gson(de.q60.mps.shadowmodels.web.lib/)\" />\n+ <import index=\"wy2b\" ref=\"87f4b21e-a3a5-459e-a54b-408fd9eb7350/java:com.google.gson(de.q60.mps.web.lib/)\" />\n<import index=\"t6h5\" ref=\"6354ebe7-c22a-4a0f-ac54-50b52ab9b065/java:java.lang.reflect(JDK/)\" />\n<import index=\"wyt6\" ref=\"6354ebe7-c22a-4a0f-ac54-50b52ab9b065/java:java.lang(JDK/)\" implicit=\"true\" />\n<import index=\"guwi\" ref=\"6354ebe7-c22a-4a0f-ac54-50b52ab9b065/java:java.io(JDK/)\" implicit=\"true\" />\n" }, { "change_type": "MODIFY", "old_path": "mps/de.q60.mps.web.model/models/de.q60.mps.web.model.persistent.mps", "new_path": "mps/de.q60.mps.web.model/models/de.q60.mps.web.model.persistent.mps", "diff": "<import index=\"t6h5\" ref=\"6354ebe7-c22a-4a0f-ac54-50b52ab9b065/java:java.lang.reflect(JDK/)\" />\n<import index=\"zdal\" ref=\"r:88aa2c17-3990-45f2-9b79-06884112d260(de.q60.mps.web.model)\" />\n<import index=\"ydze\" ref=\"r:c65aa0cf-b22b-4cca-bd88-3210b1c2f55f(de.q60.mps.web.model.operations)\" />\n- <import index=\"14ci\" ref=\"87f4b21e-a3a5-459e-a54b-408fd9eb7350/java:com.google.gson.reflect(de.q60.mps.shadowmodels.web.lib/)\" />\n+ <import index=\"14ci\" ref=\"87f4b21e-a3a5-459e-a54b-408fd9eb7350/java:com.google.gson.reflect(de.q60.mps.web.lib/)\" />\n<import index=\"c9jv\" ref=\"87f4b21e-a3a5-459e-a54b-408fd9eb7350/java:com.google.gson.stream(de.q60.mps.shadowmodels.web.lib/)\" />\n<import index=\"guwi\" ref=\"6354ebe7-c22a-4a0f-ac54-50b52ab9b065/java:java.io(JDK/)\" />\n<import index=\"6shs\" ref=\"r:3ca2f5b1-1b25-441b-b059-2ddba424a0b1(de.q60.mps.web.model.persistent)\" />\n- <import index=\"pl94\" ref=\"87f4b21e-a3a5-459e-a54b-408fd9eb7350/java:com.google.gson.internal(de.q60.mps.shadowmodels.web.lib/)\" />\n+ <import index=\"pl94\" ref=\"87f4b21e-a3a5-459e-a54b-408fd9eb7350/java:com.google.gson.internal(de.q60.mps.web.lib/)\" />\n<import index=\"mjcn\" ref=\"r:89ac1ee0-92ac-49e1-83e6-167854d2040e(de.q60.mps.shadowmodels.runtime.model)\" />\n<import index=\"l6bp\" ref=\"r:97875f9c-321e-405e-a344-6d3deab2bdba(de.q60.mps.shadowmodels.runtime.smodel)\" />\n<import index=\"vxxo\" ref=\"6ed54515-acc8-4d1e-a16c-9fd6cfe951ea/java:jetbrains.mps.smodel.adapter.structure.concept(MPS.Core/)\" />\n" }, { "change_type": "RENAME", "old_path": "mps/de.q60.mps.shadowmodels.web.dom/de.q60.mps.shadowmodels.web.dom.mpl", "new_path": "mps/de.q60.mps.web.ui.sm.dom/de.q60.mps.web.ui.sm.dom.mpl", "diff": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n-<language namespace=\"de.q60.mps.shadowmodels.web.dom\" uuid=\"6f6906a4-f244-4806-a98b-0bc781cef2a8\" languageVersion=\"0\" moduleVersion=\"0\">\n+<language namespace=\"de.q60.mps.web.ui.sm.dom\" uuid=\"6f6906a4-f244-4806-a98b-0bc781cef2a8\" languageVersion=\"0\" moduleVersion=\"0\">\n<models>\n<modelRoot contentPath=\"${module}\" type=\"default\">\n<sourceRoot location=\"models\" />\n</models>\n<accessoryModels />\n<generators>\n- <generator alias=\"main\" namespace=\"de.q60.mps.shadowmodels.web.dom#01\" uuid=\"8eeab8ed-d51a-4f98-8dd9-0a43d1a66dd7\">\n+ <generator alias=\"main\" namespace=\"de.q60.mps.web.ui.sm.dom#01\" uuid=\"8eeab8ed-d51a-4f98-8dd9-0a43d1a66dd7\">\n<models>\n<modelRoot contentPath=\"${module}/generator/template\" type=\"default\">\n<sourceRoot location=\".\" />\n<module reference=\"6354ebe7-c22a-4a0f-ac54-50b52ab9b065(JDK)\" version=\"0\" />\n<module reference=\"6ed54515-acc8-4d1e-a16c-9fd6cfe951ea(MPS.Core)\" version=\"0\" />\n<module reference=\"8865b7a8-5271-43d3-884c-6fd1d9cfdd34(MPS.OpenAPI)\" version=\"0\" />\n- <module reference=\"6f6906a4-f244-4806-a98b-0bc781cef2a8(de.q60.mps.shadowmodels.web.dom)\" version=\"0\" />\n- <module reference=\"8eeab8ed-d51a-4f98-8dd9-0a43d1a66dd7(de.q60.mps.shadowmodels.web.dom#01)\" version=\"0\" />\n+ <module reference=\"6f6906a4-f244-4806-a98b-0bc781cef2a8(de.q60.mps.web.ui.sm.dom)\" version=\"0\" />\n+ <module reference=\"8eeab8ed-d51a-4f98-8dd9-0a43d1a66dd7(de.q60.mps.web.ui.sm.dom#01)\" version=\"0\" />\n<module reference=\"ceab5195-25ea-4f22-9b92-103b95ca8c0c(jetbrains.mps.lang.core)\" version=\"0\" />\n</dependencyVersions>\n<mapping-priorities />\n<module reference=\"6354ebe7-c22a-4a0f-ac54-50b52ab9b065(JDK)\" version=\"0\" />\n<module reference=\"6ed54515-acc8-4d1e-a16c-9fd6cfe951ea(MPS.Core)\" version=\"0\" />\n<module reference=\"8865b7a8-5271-43d3-884c-6fd1d9cfdd34(MPS.OpenAPI)\" version=\"0\" />\n- <module reference=\"6f6906a4-f244-4806-a98b-0bc781cef2a8(de.q60.mps.shadowmodels.web.dom)\" version=\"0\" />\n+ <module reference=\"6f6906a4-f244-4806-a98b-0bc781cef2a8(de.q60.mps.web.ui.sm.dom)\" version=\"0\" />\n<module reference=\"ceab5195-25ea-4f22-9b92-103b95ca8c0c(jetbrains.mps.lang.core)\" version=\"0\" />\n<module reference=\"a9e4c532-c5f5-4bb7-99ef-42abb73bbb70(jetbrains.mps.lang.descriptor.aspects)\" version=\"0\" />\n</dependencyVersions>\n" }, { "change_type": "RENAME", "old_path": "mps/de.q60.mps.shadowmodels.web.dom/generator/template/[email protected]", "new_path": "mps/de.q60.mps.web.ui.sm.dom/generator/template/[email protected]", "diff": "<devkit ref=\"a2eb3a43-fcc2-4200-80dc-c60110c4862d(jetbrains.mps.devkit.templates)\" />\n</languages>\n<imports>\n- <import index=\"70w2\" ref=\"r:59e1f3dd-5dad-4bbd-ad65-fef01059d9d2(de.q60.mps.shadowmodels.web.dom.structure)\" />\n+ <import index=\"70w2\" ref=\"r:59e1f3dd-5dad-4bbd-ad65-fef01059d9d2(de.q60.mps.web.ui.sm.dom.structure)\" />\n</imports>\n<registry>\n<language id=\"b401a680-8325-4110-8fd3-84331ff25bef\" name=\"jetbrains.mps.lang.generator\">\n" }, { "change_type": "RENAME", "old_path": "mps/de.q60.mps.shadowmodels.web.dom/models/de.q60.mps.shadowmodels.web.dom.behavior.mps", "new_path": "mps/de.q60.mps.web.ui.sm.dom/models/de.q60.mps.web.ui.sm.dom.behavior.mps", "diff": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n-<model ref=\"r:9a4843b8-50e4-4f17-85dd-1d87daa82535(de.q60.mps.shadowmodels.web.dom.behavior)\">\n+<model ref=\"r:9a4843b8-50e4-4f17-85dd-1d87daa82535(de.q60.mps.web.ui.sm.dom.behavior)\">\n<persistence version=\"9\" />\n<languages>\n<use id=\"af65afd8-f0dd-4942-87d9-63a55f2a9db1\" name=\"jetbrains.mps.lang.behavior\" version=\"2\" />\n" }, { "change_type": "RENAME", "old_path": "mps/de.q60.mps.shadowmodels.web.dom/models/de.q60.mps.shadowmodels.web.dom.constraints.mps", "new_path": "mps/de.q60.mps.web.ui.sm.dom/models/de.q60.mps.web.ui.sm.dom.constraints.mps", "diff": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n-<model ref=\"r:69f66b72-9c81-4e7b-8a40-9751f2fee8e8(de.q60.mps.shadowmodels.web.dom.constraints)\">\n+<model ref=\"r:69f66b72-9c81-4e7b-8a40-9751f2fee8e8(de.q60.mps.web.ui.sm.dom.constraints)\">\n<persistence version=\"9\" />\n<languages>\n<use id=\"3f4bc5f5-c6c1-4a28-8b10-c83066ffa4a1\" name=\"jetbrains.mps.lang.constraints\" version=\"4\" />\n" }, { "change_type": "RENAME", "old_path": "mps/de.q60.mps.shadowmodels.web.dom/models/de.q60.mps.shadowmodels.web.dom.editor.mps", "new_path": "mps/de.q60.mps.web.ui.sm.dom/models/de.q60.mps.web.ui.sm.dom.editor.mps", "diff": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n-<model ref=\"r:7c34fb41-94f9-4510-96b7-7a94a5d686ff(de.q60.mps.shadowmodels.web.dom.editor)\">\n+<model ref=\"r:7c34fb41-94f9-4510-96b7-7a94a5d686ff(de.q60.mps.web.ui.sm.dom.editor)\">\n<persistence version=\"9\" />\n<languages>\n<use id=\"18bc6592-03a6-4e29-a83a-7ff23bde13ba\" name=\"jetbrains.mps.lang.editor\" version=\"12\" />\n" }, { "change_type": "RENAME", "old_path": "mps/de.q60.mps.shadowmodels.web.dom/models/de.q60.mps.shadowmodels.web.dom.structure.mps", "new_path": "mps/de.q60.mps.web.ui.sm.dom/models/de.q60.mps.web.ui.sm.dom.structure.mps", "diff": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n-<model ref=\"r:59e1f3dd-5dad-4bbd-ad65-fef01059d9d2(de.q60.mps.shadowmodels.web.dom.structure)\">\n+<model ref=\"r:59e1f3dd-5dad-4bbd-ad65-fef01059d9d2(de.q60.mps.web.ui.sm.dom.structure)\">\n<persistence version=\"9\" />\n<languages>\n<use id=\"c72da2b9-7cce-4447-8389-f407dc1158b7\" name=\"jetbrains.mps.lang.structure\" version=\"7\" />\n" }, { "change_type": "RENAME", "old_path": "mps/de.q60.mps.shadowmodels.web.dom/models/de.q60.mps.shadowmodels.web.dom.typesystem.mps", "new_path": "mps/de.q60.mps.web.ui.sm.dom/models/de.q60.mps.web.ui.sm.dom.typesystem.mps", "diff": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n-<model ref=\"r:b1b4ef75-b54a-4e47-b951-d722100ba2a0(de.q60.mps.shadowmodels.web.dom.typesystem)\">\n+<model ref=\"r:b1b4ef75-b54a-4e47-b951-d722100ba2a0(de.q60.mps.web.ui.sm.dom.typesystem)\">\n<persistence version=\"9\" />\n<languages>\n<use id=\"7a5dda62-9140-4668-ab76-d5ed1746f2b2\" name=\"jetbrains.mps.lang.typesystem\" version=\"1\" />\n" }, { "change_type": "MODIFY", "old_path": "mps/de.q60.mps.web.ui.sm.server/de.q60.mps.web.ui.sm.server.msd", "new_path": "mps/de.q60.mps.web.ui.sm.server/de.q60.mps.web.ui.sm.server.msd", "diff": "<dependency reexport=\"false\">87f4b21e-a3a5-459e-a54b-408fd9eb7350(de.q60.mps.web.lib)</dependency>\n<dependency reexport=\"true\">e52a4835-844d-46a1-99f8-c06129db796f(de.q60.mps.shadowmodels.runtime)</dependency>\n<dependency reexport=\"false\">78874af2-5dd2-42a7-a21d-42fab3737d1d(de.q60.mps.shadowmodels.web)</dependency>\n- <dependency reexport=\"false\">6f6906a4-f244-4806-a98b-0bc781cef2a8(de.q60.mps.shadowmodels.web.dom)</dependency>\n+ <dependency reexport=\"false\">6f6906a4-f244-4806-a98b-0bc781cef2a8(de.q60.mps.web.ui.sm.dom)</dependency>\n<dependency reexport=\"false\">94b64715-a263-4c36-a138-8da14705ffa7(de.q60.mps.shadowmodels.transformation)</dependency>\n<dependency reexport=\"false\">a7322769-ef64-4daa-a2f4-fd4228fb713e(de.q60.mps.shadowmodels.target.text)</dependency>\n<dependency reexport=\"false\">0f2359af-040e-43bb-b438-cf024da41518(de.q60.mps.shadowmodels.web.json)</dependency>\n<module reference=\"a7322769-ef64-4daa-a2f4-fd4228fb713e(de.q60.mps.shadowmodels.target.text)\" version=\"0\" />\n<module reference=\"94b64715-a263-4c36-a138-8da14705ffa7(de.q60.mps.shadowmodels.transformation)\" version=\"0\" />\n<module reference=\"78874af2-5dd2-42a7-a21d-42fab3737d1d(de.q60.mps.shadowmodels.web)\" version=\"1\" />\n- <module reference=\"6f6906a4-f244-4806-a98b-0bc781cef2a8(de.q60.mps.shadowmodels.web.dom)\" version=\"0\" />\n<module reference=\"0f2359af-040e-43bb-b438-cf024da41518(de.q60.mps.shadowmodels.web.json)\" version=\"0\" />\n<module reference=\"87f4b21e-a3a5-459e-a54b-408fd9eb7350(de.q60.mps.web.lib)\" version=\"0\" />\n+ <module reference=\"6f6906a4-f244-4806-a98b-0bc781cef2a8(de.q60.mps.web.ui.sm.dom)\" version=\"0\" />\n<module reference=\"eb8d1040-bff5-4126-8949-fdd95ef4c502(de.q60.mps.web.ui.sm.server)\" version=\"0\" />\n<module reference=\"f3061a53-9226-4cc5-a443-f952ceaf5816(jetbrains.mps.baseLanguage)\" version=\"0\" />\n<module reference=\"e39e4a59-8cb6-498e-860e-8fa8361c0d90(jetbrains.mps.baseLanguage.scopes)\" version=\"0\" />\n" }, { "change_type": "MODIFY", "old_path": "mps/de.q60.mps.web.ui.sm.server/models/de.q60.mps.web.ui.sm.server.plugin.mps", "new_path": "mps/de.q60.mps.web.ui.sm.server/models/de.q60.mps.web.ui.sm.server.plugin.mps", "diff": "<devkit ref=\"fbc25dd2-5da4-483a-8b19-70928e1b62d7(jetbrains.mps.devkit.general-purpose)\" />\n</languages>\n<imports>\n- <import index=\"mi4d\" ref=\"87f4b21e-a3a5-459e-a54b-408fd9eb7350/java:org.java_websocket.server(de.q60.mps.shadowmodels.web.lib/)\" />\n+ <import index=\"mi4d\" ref=\"87f4b21e-a3a5-459e-a54b-408fd9eb7350/java:org.java_websocket.server(de.q60.mps.web.lib/)\" />\n<import index=\"nv3w\" ref=\"r:18e93978-2322-49a8-aaab-61c6faf67e2a(de.q60.mps.shadowmodels.runtime.engine)\" />\n<import index=\"od2j\" ref=\"r:19d224b8-fac8-4b19-ae42-e7b119858f3b(de.q60.mps.polymorphicfunctions.runtime)\" />\n<import index=\"l6bp\" ref=\"r:97875f9c-321e-405e-a344-6d3deab2bdba(de.q60.mps.shadowmodels.runtime.smodel)\" />\n- <import index=\"ffp0\" ref=\"87f4b21e-a3a5-459e-a54b-408fd9eb7350/java:org.java_websocket(de.q60.mps.shadowmodels.web.lib/)\" />\n+ <import index=\"ffp0\" ref=\"87f4b21e-a3a5-459e-a54b-408fd9eb7350/java:org.java_websocket(de.q60.mps.web.lib/)\" />\n<import index=\"zf81\" ref=\"6354ebe7-c22a-4a0f-ac54-50b52ab9b065/java:java.net(JDK/)\" />\n- <import index=\"bge5\" ref=\"87f4b21e-a3a5-459e-a54b-408fd9eb7350/java:org.java_websocket.handshake(de.q60.mps.shadowmodels.web.lib/)\" />\n+ <import index=\"bge5\" ref=\"87f4b21e-a3a5-459e-a54b-408fd9eb7350/java:org.java_websocket.handshake(de.q60.mps.web.lib/)\" />\n<import index=\"wyt6\" ref=\"6354ebe7-c22a-4a0f-ac54-50b52ab9b065/java:java.lang(JDK/)\" />\n<import index=\"mxf6\" ref=\"87f4b21e-a3a5-459e-a54b-408fd9eb7350/java:org.json(de.q60.mps.shadowmodels.web.lib/)\" />\n<import index=\"guwi\" ref=\"6354ebe7-c22a-4a0f-ac54-50b52ab9b065/java:java.io(JDK/)\" />\n" } ]
Kotlin
Apache License 2.0
modelix/modelix
Rename de.q60.mps.shadowmodels.web.dom -> de.q60.mps.web.ui.sm.dom