Skip to content

Commit

Permalink
style: changing the path of all interfaces for code organization
Browse files Browse the repository at this point in the history
  • Loading branch information
jagalindo committed Jun 6, 2023
1 parent 8245009 commit afa01c5
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from flasgger import Swagger

# Importing routes
from routes.operations_routes import operations_bp
from flamapy.interfaces.rest.operations_routes import operations_bp

# Creating the app and configuring the cors
app = Flask(__name__)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,64 +233,64 @@ def dead_features():
"""This endpoint returns the maximum depth of the feature tree.
---
tags:
- Max depth
- Dead features
parameters:
- name: model
in: formData
type: file
required: true
responses:
200:
description: An integer representing the deep of the tree
description: A list of dead features
examples:
result: 5
result: ['lettuce', 'tomato', 'onion']
"""
return _api_call("dead_features")

@operations_bp.route('/error_detection', methods=['POST'])
def error_detection():
"""This endpoint returns the maximum depth of the feature tree.
"""This endpoint returns the list of errors within a feature model.
---
tags:
- Max depth
- Error detection
parameters:
- name: model
in: formData
type: file
required: true
responses:
200:
description: An integer representing the deep of the tree
description: A list of errors
examples:
result: 5
result: ['lettuce is a dead feature', 'tomato is a false optional']
"""
return _api_call("error_detection")

@operations_bp.route('/false_optional_features', methods=['POST'])
def false_optional_features():
"""This endpoint returns the maximum depth of the feature tree.
"""This endpoint returns the false optional features within a feature model.
---
tags:
- Max depth
- False optional features
parameters:
- name: model
in: formData
type: file
required: true
responses:
200:
description: An integer representing the deep of the tree
description: A list of false optional features
examples:
result: 5
result: ['lettuce', 'tomato', 'onion']
"""
return _api_call("false_optional_features")

@operations_bp.route('/filter', methods=['POST'])
def filter():
"""This endpoint returns the maximum depth of the feature tree.
"""This endpoint returns the products of a models that contains a certain feature.
---
tags:
- Max depth
- Filter
parameters:
- name: model
in: formData
Expand All @@ -302,56 +302,56 @@ def filter():
required: true
responses:
200:
description: An integer representing the deep of the tree
description: A list of products
examples:
result: 5
result: [['lettuce', 'tomato', 'onion'], ['lettuce2', 'tomato2', 'onion']
"""
return _api_call("filter")

@operations_bp.route('/products_number', methods=['POST'])
def products_number():
"""This endpoint returns the maximum depth of the feature tree.
"""This endpoint returns the number of products within a model.
---
tags:
- Max depth
- Number of products
parameters:
- name: model
in: formData
type: file
required: true
responses:
200:
description: An integer representing the deep of the tree
description: An integer representing the number of products
examples:
result: 5
"""
return _api_call("products_number")

@operations_bp.route('/products', methods=['POST'])
def products():
"""This endpoint returns the maximum depth of the feature tree.
"""This endpoint returns the list of products of a model.
---
tags:
- Max depth
- Products
parameters:
- name: model
in: formData
type: file
required: true
responses:
200:
description: An integer representing the deep of the tree
description: A list of products
examples:
result: 5
result: [['lettuce', 'tomato', 'onion'], ['lettuce2', 'tomato2', 'onion']]
"""
return _api_call("products")

@operations_bp.route('/valid_configuration', methods=['POST'])
def valid_configuration():
"""This endpoint returns the maximum depth of the feature tree.
"""This endpoint returns a boolean indicating if a partial configuration is valid.
---
tags:
- Max depth
- Valid partial configuration
parameters:
- name: model
in: formData
Expand All @@ -363,18 +363,18 @@ def valid_configuration():
required: true
responses:
200:
description: An integer representing the deep of the tree
description: A boolean indicating if the configuration is valid
examples:
result: 5
result: True
"""
return _api_call("valid_configuration")

@operations_bp.route('/valid_product', methods=['POST'])
def valid_product():
"""This endpoint returns the maximum depth of the feature tree.
"""This endpoint returns a boolean if a fulll configuration (a.k.a product) is valid.
---
tags:
- Max depth
- Valid full configuration (a.k.a. product)
parameters:
- name: model
in: formData
Expand All @@ -386,27 +386,27 @@ def valid_product():
required: true
responses:
200:
description: An integer representing the deep of the tree
description: A boolean indicating if the configuration is valid
examples:
result: 5
result: True
"""
return _api_call("valid_product")

@operations_bp.route('/valid', methods=['POST'])
def valid():
"""This endpoint returns the maximum depth of the feature tree.
"""This endpoint returns a boolean indicating if the model is valid.
---
tags:
- Max depth
- Valid
parameters:
- name: model
in: formData
type: file
required: true
responses:
200:
description: An integer representing the deep of the tree
description: A boolean indicating if the model is valid
examples:
result: 5
result: True
"""
return _api_call("valid")

0 comments on commit afa01c5

Please sign in to comment.