def _get_port_definitions(app):
    """
    Get the ``portDefinitions`` field for the app if present.
    """
    if 'portDefinitions' in app:
        return app['portDefinitions']
    if 'ports' in app:
        return app['ports']
    return None
