Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DOML Model Checker
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PIACERE
public
The Platform
DOML Model Checker
Commits
fe7c940e
Unverified
Commit
fe7c940e
authored
2 years ago
by
Andrea Franchini
Browse files
Options
Downloads
Patches
Plain Diff
Add ?version query param to /modelcheck endpoint
parent
ae577f8d
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
mc_openapi/doml_mc/xmi_parser/doml_model.py
+5
-1
5 additions, 1 deletion
mc_openapi/doml_mc/xmi_parser/doml_model.py
mc_openapi/handlers.py
+7
-4
7 additions, 4 deletions
mc_openapi/handlers.py
mc_openapi/openapi/model_checker.yaml
+13
-2
13 additions, 2 deletions
mc_openapi/openapi/model_checker.yaml
with
25 additions
and
7 deletions
mc_openapi/doml_mc/xmi_parser/doml_model.py
+
5
−
1
View file @
fe7c940e
import
copy
import
importlib.resources
as
ilres
import
sys
from
typing
import
Optional
,
Tuple
from
lxml
import
etree
...
...
@@ -90,7 +91,10 @@ def parse_doml_model(raw_model: bytes, doml_version: Optional[DOMLVersion]) -> T
model
,
doml_version
=
get_model
(
raw_model
,
doml_version
)
else
:
# if user specifies DOML version, respect that choice!
try
:
model
=
parse_xmi_model
(
raw_model
,
doml_version
)
except
:
raise
Exception
(
"
Parsing of DOML failed. Perhaps you are using the wrong DOML version or IDE?
"
)
print
(
f
"
Using DOML
{
doml_version
.
value
}
"
)
...
...
This diff is collapsed.
Click to expand it.
mc_openapi/handlers.py
+
7
−
4
View file @
fe7c940e
...
...
@@ -15,17 +15,20 @@ def make_error(user_msg, debug_msg=None):
print
(
f
"
ERROR [
{
datetime
.
datetime
.
now
()
}
]:
{
debug_msg
}
"
)
return
result
def
post
(
body
):
def
post
(
body
,
version
=
None
):
doml_xmi
=
body
try
:
doml_version
=
None
try
:
doml_version
:
str
=
os
.
environ
[
"
DOML_VERSION
"
]
doml_version
=
DOMLVersion
.
get
(
doml_version
)
print
(
"
Setting DOML version from DOML_VERSION
"
)
except
:
pass
if
version
:
doml_version
:
str
=
version
if
doml_version
:
doml_version
=
DOMLVersion
.
get
(
doml_version
)
print
(
f
"
Forcing DOML
{
doml_version
.
value
}
"
)
dmc
=
ModelChecker
(
doml_xmi
,
doml_version
)
user_req_store
=
None
...
...
This diff is collapsed.
Click to expand it.
mc_openapi/openapi/model_checker.yaml
+
13
−
2
View file @
fe7c940e
...
...
@@ -3,12 +3,13 @@ info:
license
:
name
:
Apache-2.0
title
:
PIACERE Model Checker
version
:
"
1
.0"
version
:
"
2.2
.0"
paths
:
/modelcheck
:
post
:
summary
:
Verify a DOML model
description
:
Send a DOML model in XMI format and a requirement to check.
The response says whether the requirement
is
satisfied by the model,
The response says whether the requirement
s are
satisfied by the model,
with a description of the issue if it is not.
operationId
:
mc_openapi.handlers.post
requestBody
:
...
...
@@ -17,6 +18,16 @@ paths:
schema
:
type
:
string
required
:
true
parameters
:
-
in
:
query
name
:
version
schema
:
type
:
string
description
:
>
The DOML version you're currently using, written as e.g. `2.0` or `V2_0`.
If not specified, it will try to infer it by trying to parse it for each supported
DOML version, starting with the most recent.
required
:
false
responses
:
"
200"
:
content
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment